From fa944530699726ec9001d8a356f6abbb49157845 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 4 Jul 2021 11:13:12 +0200 Subject: [PATCH] Update Fish documentation (3.3.0) --- assets/javascripts/templates/pages/about_tmpl.coffee | 2 +- lib/docs/filters/fish/clean_html_sphinx.rb | 3 +++ lib/docs/filters/fish/entries_sphinx.rb | 6 +++++- lib/docs/scrapers/fish.rb | 10 +++++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index c0305f2d..c23848bd 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -303,7 +303,7 @@ credits = [ 'https://raw.githubusercontent.com/falconry/falcon/master/LICENSE' ], [ 'Fish', - '2005-2009 Axel Liljencrantz, 2009-2020 fish-shell contributors', + '2005–2009 Axel Liljencrantz, 2009–2021 fish-shell contributors', 'GPLv2', 'https://fishshell.com/docs/current/license.html' ], [ diff --git a/lib/docs/filters/fish/clean_html_sphinx.rb b/lib/docs/filters/fish/clean_html_sphinx.rb index 1d59c13b..d14832a4 100755 --- a/lib/docs/filters/fish/clean_html_sphinx.rb +++ b/lib/docs/filters/fish/clean_html_sphinx.rb @@ -3,6 +3,9 @@ module Docs class CleanHtmlSphinxFilter < Filter def call @doc = at_css('.body') + css('pre[data-language="fish"]').each do |node| + node['data-language'] = 'shell' + end doc end end diff --git a/lib/docs/filters/fish/entries_sphinx.rb b/lib/docs/filters/fish/entries_sphinx.rb index 50341823..9d33de17 100755 --- a/lib/docs/filters/fish/entries_sphinx.rb +++ b/lib/docs/filters/fish/entries_sphinx.rb @@ -20,13 +20,17 @@ module Docs 'Commands' elsif slug == 'tutorial' 'Tutorial' + elsif slug == 'interactive' + 'Interactive use' + elsif slug == 'language' + 'fish language' else nil # Remaining pages are indexes we don't need end end def additional_entries - if root_page? || slug == 'tutorial' + if root_page? || slug == 'tutorial' || slug == 'interactive' || slug == 'language' css('h2').map.with_index do |node, i| name = node.content.split(' - ').first.strip name.prepend "#{i + 1}. " diff --git a/lib/docs/scrapers/fish.rb b/lib/docs/scrapers/fish.rb index 08f240e9..f828d7aa 100644 --- a/lib/docs/scrapers/fish.rb +++ b/lib/docs/scrapers/fish.rb @@ -12,10 +12,18 @@ module Docs # https://fishshell.com/docs/current/license.html options[:attribution] = <<-HTML - © 2020 fish-shell developers
+ © 2021 fish-shell developers
Licensed under the GNU General Public License, version 2. HTML + version '3.3' do + self.release = '3.3.0' + self.base_url = "https://fishshell.com/docs/#{version}/" + + options[:skip].concat %w(genindex.html relnotes.html) + html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx' + end + version '3.2' do self.release = '3.2.0' self.base_url = "https://fishshell.com/docs/#{version}/"