Bläddra i källkod

Update Fish documentation (3.3.0)

Simon Legner 4 år sedan
förälder
incheckning
fa94453069

+ 1 - 1
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'
   ], [

+ 3 - 0
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

+ 5 - 1
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}. "

+ 9 - 1
lib/docs/scrapers/fish.rb

@@ -12,10 +12,18 @@ module Docs
 
     # https://fishshell.com/docs/current/license.html
     options[:attribution] = <<-HTML
-      &copy; 2020 fish-shell developers<br>
+      &copy; 2021 fish-shell developers<br>
       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}/"