[devdocsgjs/main: 849/1867] vue: update scraper and filters for 2.6.10




commit 751bf6e7d51a37f16d9e285f5674a2bacfd893be
Author: Jasper van Merle <jaspervmerle gmail com>
Date:   Tue Aug 20 15:09:05 2019 +0200

    vue: update scraper and filters for 2.6.10

 assets/javascripts/templates/pages/about_tmpl.coffee |  4 ++--
 lib/docs/filters/vue/clean_html.rb                   |  9 +++++++++
 lib/docs/filters/vue/entries.rb                      | 14 +++++++++++++-
 lib/docs/scrapers/vue.rb                             |  2 +-
 4 files changed, 25 insertions(+), 4 deletions(-)
---
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee 
b/assets/javascripts/templates/pages/about_tmpl.coffee
index b4c174fa..90e1ca4d 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -720,9 +720,9 @@ credits = [
     'https://raw.githubusercontent.com/mitchellh/vagrant/master/website/LICENSE.md'
   ], [
     'Vue.js',
-    '2013-2019 Evan You, Vue.js contributors',
+    '2013-present Yuxi Evan You',
     'MIT',
-    'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE'
+    'https://raw.githubusercontent.com/vuejs/vuejs.org/master/LICENSE'
   ], [
     'Vulkan',
     '2014-2017 Khronos Group Inc.<br>Vulkan and the Vulkan logo are registered trademarks of the Khronos 
Group Inc.',
diff --git a/lib/docs/filters/vue/clean_html.rb b/lib/docs/filters/vue/clean_html.rb
index e9fa8f67..51c735ff 100644
--- a/lib/docs/filters/vue/clean_html.rb
+++ b/lib/docs/filters/vue/clean_html.rb
@@ -16,10 +16,19 @@ module Docs
           node['data-language'] = node['class'][/highlight (\w+)/, 1]
         end
 
+        css('pre').each do |node|
+          node.content = node.content.strip
+          node['data-language'] = 'javascript'
+        end
+
         css('iframe').each do |node|
           node['sandbox'] = 'allow-forms allow-scripts allow-same-origin'
         end
 
+        css('details').each do |node|
+          node.name = 'div'
+        end
+
         doc
       end
     end
diff --git a/lib/docs/filters/vue/entries.rb b/lib/docs/filters/vue/entries.rb
index 545dbc13..6523a924 100644
--- a/lib/docs/filters/vue/entries.rb
+++ b/lib/docs/filters/vue/entries.rb
@@ -4,6 +4,8 @@ module Docs
       def get_name
         if slug == 'api/'
           'API'
+        elsif slug == 'style-guide/'
+          'Style Guide'
         else
           name = at_css('.content h1').content
           node = at_css(".sidebar .menu-root a[href='#{File.basename(slug)}']")
@@ -16,6 +18,8 @@ module Docs
       def get_type
         if slug.start_with?('guide')
           'Guide'
+        elsif slug == 'style-guide/'
+          'Style Guide'
         else
           'API'
         end
@@ -31,7 +35,15 @@ module Docs
           else
             name = node.content.strip
             name.sub! %r{\(.*\)}, '()'
-            entries << [name, node['id'], "API: #{type}"]
+            name.sub! /(essential|strongly recommended|recommended|use with caution)\Z/, ''
+
+            current_type = "API: #{type}"
+            if slug == 'style-guide/'
+              current_type = "Style Guide: "
+              current_type += type.sub(/( Rules: )/, ': ').split('(')[0]
+            end
+
+            entries << [name, node['id'], current_type]
           end
         end
       end
diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb
index 3555fa06..8cf48242 100644
--- a/lib/docs/scrapers/vue.rb
+++ b/lib/docs/scrapers/vue.rb
@@ -15,7 +15,7 @@ module Docs
     options[:replace_paths] = { 'guide/' => 'guide/index.html' }
 
     options[:attribution] = <<-HTML
-      &copy; 2013&ndash;2019 Evan You, Vue.js contributors<br>
+      &copy; 2013&ndash;present Yuxi Evan You<br>
       Licensed under the MIT License.
     HTML
 


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