diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 211b9036..4ec24e0e 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -758,9 +758,9 @@ credits = [ 'https://raw.githubusercontent.com/vuejs/vue-router/dev/LICENSE' ], [ 'Vue.js', - '2013-2018 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' ], [ 'Vuex', '2015-present Evan You', 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..c3bf4462 100644 --- a/lib/docs/filters/vue/entries.rb +++ b/lib/docs/filters/vue/entries.rb @@ -2,11 +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 @@ -16,6 +21,8 @@ module Docs def get_type if slug.start_with?('guide') 'Guide' + elsif slug == 'style-guide/' + 'Style Guide' else 'API' end @@ -31,7 +38,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 333ade1d..8cf48242 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–present Yuxi Evan You
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/)