fish.rb 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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; 2019 fish-shell developers<br>
  14. Licensed under the GNU General Public License, version 2.
  15. HTML
  16. version '3.1' do
  17. self.release = '3.1.2'
  18. self.base_url = "https://fishshell.com/docs/#{version}/"
  19. options[:skip].concat %w(genindex.html commands.html)
  20. html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
  21. end
  22. version '3.0' do
  23. self.release = '3.0.1'
  24. self.base_url = "https://fishshell.com/docs/#{version}/"
  25. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  26. end
  27. version '2.7' do
  28. self.release = '2.7.1'
  29. self.base_url = "https://fishshell.com/docs/#{version}/"
  30. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  31. end
  32. version '2.6' do
  33. self.release = '2.6.0'
  34. self.base_url = "https://fishshell.com/docs/#{version}/"
  35. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  36. end
  37. version '2.5' do
  38. self.release = '2.5.0'
  39. self.base_url = "https://fishshell.com/docs/#{version}/"
  40. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  41. end
  42. version '2.4' do
  43. self.release = '2.4.0'
  44. self.base_url = "https://fishshell.com/docs/#{version}/"
  45. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  46. end
  47. version '2.3' do
  48. self.release = '2.3.1'
  49. self.base_url = "https://fishshell.com/docs/#{version}/"
  50. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  51. end
  52. version '2.2' do
  53. self.release = '2.2.0'
  54. self.base_url = "https://fishshell.com/docs/#{version}/"
  55. html_filters.push 'fish/clean_html_custom', 'fish/entries_custom'
  56. end
  57. def get_latest_version(opts)
  58. get_latest_github_release('fish-shell', 'fish-shell', opts)
  59. end
  60. end
  61. end