[devdocsgjs/main: 9/15] Update Vite documentation (3.0.4)




commit 8e21f967c9e03aaece9ba5a0833ad53c016a13fa
Author: Simon Legner <Simon Legner gmail com>
Date:   Sun Jul 31 09:09:28 2022 +0200

    Update Vite documentation (3.0.4)

 lib/docs/filters/vite/clean_html.rb | 10 ++--------
 lib/docs/filters/vite/entries.rb    |  2 +-
 lib/docs/scrapers/vite.rb           |  4 +++-
 3 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/lib/docs/filters/vite/clean_html.rb b/lib/docs/filters/vite/clean_html.rb
index 5eae8dce..18cf1d55 100644
--- a/lib/docs/filters/vite/clean_html.rb
+++ b/lib/docs/filters/vite/clean_html.rb
@@ -3,7 +3,7 @@ module Docs
     class CleanHtmlFilter < Filter
       def call
         return '<h1>Vite</h1>' if root_page?
-        @doc = at_css('main .content > div')
+        @doc = at_css('main h1').parent
 
         css('.demo', '.guide-links', '.footer', '#ad').remove
         css('.header-anchor', '.page-edit', '.page-nav').remove
@@ -14,6 +14,7 @@ module Docs
 
         # Remove CodePen div
         css('.codepen').each do |node|
+          raise "dsfsdfsdf"
           next if node.previous_element.nil?
           span = node.css('span:contains("See the Pen")').remove
           node.previous_element.add_child(' ')
@@ -21,13 +22,6 @@ module Docs
           node.remove
         end
 
-        # Remove code highlighting
-        css('figure').each do |node|
-          node.name = 'pre'
-          node.content = node.at_css('td.code pre').css('.line').map(&:content).join("\n")
-          node['data-language'] = node['class'][/highlight (\w+)/, 1]
-        end
-
         css('.line-numbers-wrapper').remove
         css('pre').each do |node|
           node.content = node.content.strip
diff --git a/lib/docs/filters/vite/entries.rb b/lib/docs/filters/vite/entries.rb
index 99c5762c..422a0eee 100644
--- a/lib/docs/filters/vite/entries.rb
+++ b/lib/docs/filters/vite/entries.rb
@@ -8,7 +8,7 @@ module Docs
       end
 
       def get_type
-        at_css('header nav .item.active').content.strip
+        at_css('aside nav .title-text').content.strip
       end
 
       def additional_entries
diff --git a/lib/docs/scrapers/vite.rb b/lib/docs/scrapers/vite.rb
index 15758a21..89009b82 100644
--- a/lib/docs/scrapers/vite.rb
+++ b/lib/docs/scrapers/vite.rb
@@ -15,7 +15,9 @@ module Docs
       Licensed under the MIT License.
     HTML
 
-    self.release = '2.9.1'
+    options[:skip] = %w(team.html plugins/)
+
+    self.release = '3.0.4'
     self.base_url = 'https://vitejs.dev/'
     self.initial_paths = %w(guide/)
     html_filters.push 'vite/entries', 'vite/clean_html'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]