fish.rb 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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; 2005-2009 Axel Liljencrantz, 2009-2023 fish-shell contributors<br>
  14. Licensed under the GNU General Public License, version 2.
  15. HTML
  16. version '3.6' do
  17. self.release = '3.6.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.5' do
  23. self.release = '3.5.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.4' do
  29. self.release = '3.4.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.3' do
  35. self.release = '3.3.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.2' do
  41. self.release = '3.2.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.1' do
  47. self.release = '3.1.2'
  48. self.base_url = "https://fishshell.com/docs/#{version}/"
  49. options[:skip].concat %w(genindex.html commands.html)
  50. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  51. end
  52. version '3.0' do
  53. self.release = '3.0.1'
  54. self.base_url = "https://fishshell.com/docs/#{version}/"
  55. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  56. end
  57. version '2.7' do
  58. self.release = '2.7.1'
  59. self.base_url = "https://fishshell.com/docs/#{version}/"
  60. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  61. end
  62. version '2.6' do
  63. self.release = '2.6.0'
  64. self.base_url = "https://fishshell.com/docs/#{version}/"
  65. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  66. end
  67. version '2.5' do
  68. self.release = '2.5.0'
  69. self.base_url = "https://fishshell.com/docs/#{version}/"
  70. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  71. end
  72. version '2.4' do
  73. self.release = '2.4.0'
  74. self.base_url = "https://fishshell.com/docs/#{version}/"
  75. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  76. end
  77. version '2.3' do
  78. self.release = '2.3.1'
  79. self.base_url = "https://fishshell.com/docs/#{version}/"
  80. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  81. end
  82. version '2.2' do
  83. self.release = '2.2.0'
  84. self.base_url = "https://fishshell.com/docs/#{version}/"
  85. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  86. end
  87. def get_latest_version(opts)
  88. get_latest_github_release('fish-shell', 'fish-shell', opts)
  89. end
  90. end
  91. end