From 11bcab7464907f3564ebb9477c73bb38b3bb3e37 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 1 Nov 2015 10:35:42 -0500 Subject: [PATCH] Update Vue.js documentation (1.0.4) --- assets/stylesheets/application-dark.css.scss | 1 + assets/stylesheets/application.css.scss | 1 + lib/docs/filters/vue/clean_html.rb | 2 +- lib/docs/filters/vue/entries.rb | 15 ++++++++++----- lib/docs/scrapers/vue.rb | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index 66cd7c72..e1dfe466 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -71,5 +71,6 @@ 'pages/socketio', 'pages/sphinx', 'pages/underscore', + 'pages/vue', 'pages/yard', 'pages/yii'; diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 09580553..dbc803fb 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -71,5 +71,6 @@ 'pages/socketio', 'pages/sphinx', 'pages/underscore', + 'pages/vue', 'pages/yard', 'pages/yii'; diff --git a/lib/docs/filters/vue/clean_html.rb b/lib/docs/filters/vue/clean_html.rb index 87e5bfa7..980eaea4 100644 --- a/lib/docs/filters/vue/clean_html.rb +++ b/lib/docs/filters/vue/clean_html.rb @@ -6,7 +6,7 @@ module Docs at_css('h1').content = 'Vue.js' if root_page? - css('#demo').remove + css('.demo', '.guide-links', '.footer').remove # Remove code highlighting css('figure').each do |node| diff --git a/lib/docs/filters/vue/entries.rb b/lib/docs/filters/vue/entries.rb index 5a54e1b8..5499b109 100644 --- a/lib/docs/filters/vue/entries.rb +++ b/lib/docs/filters/vue/entries.rb @@ -2,7 +2,7 @@ module Docs class Vue class EntriesFilter < Docs::EntriesFilter def get_name - at_css('h1').content + at_css('h1').content.presence || 'API' end def get_type @@ -15,11 +15,16 @@ module Docs def additional_entries return [] if slug.start_with?('guide') + type = nil - css('h3').map do |node| - name = node.content.strip - name.sub! %r{\(.*\)}, '()' - [name, node['id'], "API: #{self.name}"] + css('h2, h3').each_with_object [] do |node, entries| + if node.name == 'h2' + type = node.content.strip + else + name = node.content.strip + name.sub! %r{\(.*\)}, '()' + entries << [name, node['id'], "API: #{type}"] + end end end end diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index b084fbf3..c7d5b70e 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -3,7 +3,7 @@ module Docs self.name = 'Vue.js' self.slug = 'vue' self.type = 'vue' - self.version = '0.12.14' + self.version = '1.0.4' self.base_url = 'http://vuejs.org' self.root_path = '/guide/index.html' self.initial_paths = %w(/api/index.html)