From 710b1151ecf038c64c4c0b8504857f3f244bce13 Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Tue, 13 Aug 2019 16:24:42 +0800 Subject: [PATCH 1/4] bump vue to 2.6.10 --- lib/docs/scrapers/vue.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index 333ade1d..3555fa06 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -15,12 +15,12 @@ module Docs options[:replace_paths] = { 'guide/' => 'guide/index.html' } options[:attribution] = <<-HTML - © 2013–2018 Evan You, Vue.js contributors
+ © 2013–2019 Evan You, Vue.js contributors
Licensed under the MIT License. HTML version '2' do - self.release = '2.5.16' + self.release = '2.6.10' self.base_url = 'https://vuejs.org/v2/' self.root_path = 'guide/index.html' self.initial_paths = %w(api/) From 4f7d93b43838adf1109bec2a55c89d7230aec67d Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Tue, 13 Aug 2019 16:24:42 +0800 Subject: [PATCH 2/4] bump vue to 2.6.10 --- assets/javascripts/templates/pages/about_tmpl.coffee | 2 +- lib/docs/scrapers/vue.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 5e9dc6cc..b4c174fa 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -720,7 +720,7 @@ credits = [ 'https://raw.githubusercontent.com/mitchellh/vagrant/master/website/LICENSE.md' ], [ 'Vue.js', - '2013-2018 Evan You, Vue.js contributors', + '2013-2019 Evan You, Vue.js contributors', 'MIT', 'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE' ], [ diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index 333ade1d..3555fa06 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -15,12 +15,12 @@ module Docs options[:replace_paths] = { 'guide/' => 'guide/index.html' } options[:attribution] = <<-HTML - © 2013–2018 Evan You, Vue.js contributors
+ © 2013–2019 Evan You, Vue.js contributors
Licensed under the MIT License. HTML version '2' do - self.release = '2.5.16' + self.release = '2.6.10' self.base_url = 'https://vuejs.org/v2/' self.root_path = 'guide/index.html' self.initial_paths = %w(api/) From 751bf6e7d51a37f16d9e285f5674a2bacfd893be Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 20 Aug 2019 15:09:05 +0200 Subject: [PATCH 3/4] vue: update scraper and filters for 2.6.10 --- .../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.
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 - © 2013–2019 Evan You, Vue.js contributors
+ © 2013–present Yuxi Evan You
Licensed under the MIT License. HTML From 6002d6a940e486b8cc4c6f8af912c12fde97e855 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 20 Aug 2019 15:17:41 +0200 Subject: [PATCH 4/4] vue: fix entries filter for v1 docs --- lib/docs/filters/vue/entries.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/vue/entries.rb b/lib/docs/filters/vue/entries.rb index 6523a924..c3bf4462 100644 --- a/lib/docs/filters/vue/entries.rb +++ b/lib/docs/filters/vue/entries.rb @@ -2,13 +2,16 @@ module Docs class Vue class EntriesFilter < Docs::EntriesFilter def get_name - if slug == 'api/' + if slug == 'api/' || slug == 'api/index' '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)}']") + + return name if node.nil? + index = node.parent.parent.css('> li > a').to_a.index(node) name.prepend "#{index + 1}. " if index name