1
0

fish.rb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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.4' do
  17. self.release = '3.4.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.3' do
  23. self.release = '3.3.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.2' do
  29. self.release = '3.2.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.1' do
  35. self.release = '3.1.2'
  36. self.base_url = "https://fishshell.com/docs/#{version}/"
  37. options[:skip].concat %w(genindex.html commands.html)
  38. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  39. end
  40. version '3.0' do
  41. self.release = '3.0.1'
  42. self.base_url = "https://fishshell.com/docs/#{version}/"
  43. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  44. end
  45. version '2.7' do
  46. self.release = '2.7.1'
  47. self.base_url = "https://fishshell.com/docs/#{version}/"
  48. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  49. end
  50. version '2.6' do
  51. self.release = '2.6.0'
  52. self.base_url = "https://fishshell.com/docs/#{version}/"
  53. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  54. end
  55. version '2.5' do
  56. self.release = '2.5.0'
  57. self.base_url = "https://fishshell.com/docs/#{version}/"
  58. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  59. end
  60. version '2.4' do
  61. self.release = '2.4.0'
  62. self.base_url = "https://fishshell.com/docs/#{version}/"
  63. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  64. end
  65. version '2.3' do
  66. self.release = '2.3.1'
  67. self.base_url = "https://fishshell.com/docs/#{version}/"
  68. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  69. end
  70. version '2.2' do
  71. self.release = '2.2.0'
  72. self.base_url = "https://fishshell.com/docs/#{version}/"
  73. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  74. end
  75. def get_latest_version(opts)
  76. get_latest_github_release('fish-shell', 'fish-shell', opts)
  77. end
  78. end
  79. end