fish.rb 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 contributing.html)
  11. # https://fishshell.com/docs/current/license.html
  12. options[:attribution] = <<-HTML
  13. &copy; 2005-2009 Axel Liljencrantz, 2009-2025 fish-shell contributors<br>
  14. Licensed under the GNU General Public License, version 2.
  15. HTML
  16. version '4.0' do
  17. self.release = '4.0.1'
  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.7' do
  23. self.release = '3.7.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.6' do
  29. self.release = '3.6.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.5' do
  35. self.release = '3.5.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.4' do
  41. self.release = '3.4.0'
  42. self.base_url = "https://fishshell.com/docs/#{version}/"
  43. options[:skip].concat %w(genindex.html relnotes.html)
  44. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  45. end
  46. version '3.3' do
  47. self.release = '3.3.0'
  48. self.base_url = "https://fishshell.com/docs/#{version}/"
  49. options[:skip].concat %w(genindex.html relnotes.html)
  50. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  51. end
  52. version '3.2' do
  53. self.release = '3.2.0'
  54. self.base_url = "https://fishshell.com/docs/#{version}/"
  55. options[:skip].concat %w(genindex.html relnotes.html)
  56. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  57. end
  58. version '3.1' do
  59. self.release = '3.1.2'
  60. self.base_url = "https://fishshell.com/docs/#{version}/"
  61. options[:skip].concat %w(genindex.html commands.html)
  62. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  63. end
  64. version '3.0' do
  65. self.release = '3.0.1'
  66. self.base_url = "https://fishshell.com/docs/#{version}/"
  67. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  68. end
  69. version '2.7' do
  70. self.release = '2.7.1'
  71. self.base_url = "https://fishshell.com/docs/#{version}/"
  72. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  73. end
  74. version '2.6' do
  75. self.release = '2.6.0'
  76. self.base_url = "https://fishshell.com/docs/#{version}/"
  77. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  78. end
  79. version '2.5' do
  80. self.release = '2.5.0'
  81. self.base_url = "https://fishshell.com/docs/#{version}/"
  82. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  83. end
  84. version '2.4' do
  85. self.release = '2.4.0'
  86. self.base_url = "https://fishshell.com/docs/#{version}/"
  87. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  88. end
  89. version '2.3' do
  90. self.release = '2.3.1'
  91. self.base_url = "https://fishshell.com/docs/#{version}/"
  92. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  93. end
  94. version '2.2' do
  95. self.release = '2.2.0'
  96. self.base_url = "https://fishshell.com/docs/#{version}/"
  97. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  98. end
  99. def get_latest_version(opts)
  100. get_latest_github_release('fish-shell', 'fish-shell', opts)
  101. end
  102. end
  103. end