[devdocsgjs/main: 1479/1867] Update Vue Router documentation (3.5.1 and 4.0.3)




commit b724e81d2f0d0bf03a48d31f973157e92c6da97c
Author: Simon Legner <Simon Legner gmail com>
Date:   Sat Jan 30 00:38:53 2021 +0100

    Update Vue Router documentation (3.5.1 and 4.0.3)

 lib/docs/filters/vue_router/clean_html.rb |  9 ++++++++-
 lib/docs/scrapers/vue_router.rb           | 14 +++++++++++---
 2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/lib/docs/filters/vue_router/clean_html.rb b/lib/docs/filters/vue_router/clean_html.rb
index 71c1a132..d7fa3968 100644
--- a/lib/docs/filters/vue_router/clean_html.rb
+++ b/lib/docs/filters/vue_router/clean_html.rb
@@ -2,7 +2,7 @@ module Docs
   class VueRouter
     class CleanHtmlFilter < Filter
       def call
-        @doc = at_css('.content')
+        @doc = at_css('main')
 
         # Remove unneeded elements
         css('.bit-sponsor, .header-anchor').remove
@@ -14,6 +14,13 @@ module Docs
           title.name = 'strong' unless title.nil?
         end
 
+        # Remove data-v-* attributes
+        css('*').each do |node|
+          node.attributes.each_key do |attribute|
+            node.remove_attribute(attribute) if attribute.start_with? 'data-v-'
+          end
+        end
+
         doc
       end
     end
diff --git a/lib/docs/scrapers/vue_router.rb b/lib/docs/scrapers/vue_router.rb
index 9f617944..accb8455 100644
--- a/lib/docs/scrapers/vue_router.rb
+++ b/lib/docs/scrapers/vue_router.rb
@@ -3,8 +3,6 @@ module Docs
     self.name = 'Vue Router'
     self.slug = 'vue_router'
     self.type = 'simple'
-    self.release = '3.1.2'
-    self.base_url = 'https://router.vuejs.org/'
     self.links = {
       home: 'https://router.vuejs.org',
       code: 'https://github.com/vuejs/vue-router'
@@ -22,8 +20,18 @@ module Docs
       Licensed under the MIT License.
     HTML
 
+    version '4' do
+      self.release = '4.0.3'
+      self.base_url = 'https://next.router.vuejs.org/'
+    end
+
+    version '3' do
+      self.release = '3.5.1'
+      self.base_url = 'https://router.vuejs.org/'
+    end
+
     def get_latest_version(opts)
-      get_latest_github_release('vuejs', 'vue-router', opts)
+      get_npm_version('vue-router', opts, 'next')
     end
   end
 end


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