fish.rb 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. module Docs
  2. class Fish < UrlScraper
  3. self.name = 'Fish'
  4. self.type = 'simple'
  5. self.root_path = 'index.html'
  6. self.links = {
  7. home: 'https://fishshell.com/',
  8. code: 'https://github.com/fish-shell/fish-shell'
  9. }
  10. options[:skip] = %w(design.html license.html)
  11. # https://fishshell.com/docs/current/license.html
  12. options[:attribution] = <<-HTML
  13. &copy; 2022 fish-shell developers<br>
  14. Licensed under the GNU General Public License, version 2.
  15. HTML
  16. version '3.5' do
  17. self.release = '3.5.0'
  18. self.base_url = "https://fishshell.com/docs/#{version}/"
  19. options[:skip].concat %w(genindex.html relnotes.html)
  20. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  21. end
  22. version '3.4' do
  23. self.release = '3.4.0'
  24. self.base_url = "https://fishshell.com/docs/#{version}/"
  25. options[:skip].concat %w(genindex.html relnotes.html)
  26. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  27. end
  28. version '3.3' do
  29. self.release = '3.3.0'
  30. self.base_url = "https://fishshell.com/docs/#{version}/"
  31. options[:skip].concat %w(genindex.html relnotes.html)
  32. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  33. end
  34. version '3.2' do
  35. self.release = '3.2.0'
  36. self.base_url = "https://fishshell.com/docs/#{version}/"
  37. options[:skip].concat %w(genindex.html relnotes.html)
  38. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  39. end
  40. version '3.1' do
  41. self.release = '3.1.2'
  42. self.base_url = "https://fishshell.com/docs/#{version}/"
  43. options[:skip].concat %w(genindex.html commands.html)
  44. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  45. end
  46. version '3.0' do
  47. self.release = '3.0.1'
  48. self.base_url = "https://fishshell.com/docs/#{version}/"
  49. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  50. end
  51. version '2.7' do
  52. self.release = '2.7.1'
  53. self.base_url = "https://fishshell.com/docs/#{version}/"
  54. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  55. end
  56. version '2.6' do
  57. self.release = '2.6.0'
  58. self.base_url = "https://fishshell.com/docs/#{version}/"
  59. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  60. end
  61. version '2.5' do
  62. self.release = '2.5.0'
  63. self.base_url = "https://fishshell.com/docs/#{version}/"
  64. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  65. end
  66. version '2.4' do
  67. self.release = '2.4.0'
  68. self.base_url = "https://fishshell.com/docs/#{version}/"
  69. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  70. end
  71. version '2.3' do
  72. self.release = '2.3.1'
  73. self.base_url = "https://fishshell.com/docs/#{version}/"
  74. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  75. end
  76. version '2.2' do
  77. self.release = '2.2.0'
  78. self.base_url = "https://fishshell.com/docs/#{version}/"
  79. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  80. end
  81. def get_latest_version(opts)
  82. get_latest_github_release('fish-shell', 'fish-shell', opts)
  83. end
  84. end
  85. end