Procházet zdrojové kódy

Update Astro documentation (2.6.3)

Simon Legner před 2 roky
rodič
revize
e53b2614a6

+ 4 - 0
lib/docs/filters/astro/clean_html.rb

@@ -26,6 +26,10 @@ module Docs
           node.before(node.children).remove
         end
 
+        css('.cms-nav').remove
+
+        css('.copy-button-wrapper, .copy-button-tooltip').remove
+
         doc
       end
     end

+ 2 - 2
lib/docs/filters/astro/entries.rb

@@ -2,7 +2,7 @@ module Docs
   class Astro
     class EntriesFilter < Docs::EntriesFilter
       def get_name
-        name = at_css('h1').content
+        name = at_css('article h1').content
         name.sub! %r{\s*#\s*}, ''
         name
       end
@@ -16,7 +16,7 @@ module Docs
       def additional_entries
         return if slug.start_with?('guides/deploy')
         return if slug.start_with?('guides/integrations-guide')
-        at_css('article').css('h2, h3').each_with_object [] do |node, entries|
+        at_css('article').css('h2[id], h3[id]').each_with_object [] do |node, entries|
           type = node.content.strip
           type.sub! %r{\s*#\s*}, ''
           entries << ["#{name}: #{type}", node['id']]

+ 1 - 1
lib/docs/scrapers/astro.rb

@@ -16,7 +16,7 @@ module Docs
 
     options[:skip_patterns] = [/tutorial/]
 
-    self.release = '2.0.0'
+    self.release = '2.6.3'
     self.base_url = 'https://docs.astro.build/en/'
     self.initial_paths = %w(getting-started/)