diff --git a/lib/docs/filters/vue/entries.rb b/lib/docs/filters/vue/entries.rb index 012a2d52..545dbc13 100644 --- a/lib/docs/filters/vue/entries.rb +++ b/lib/docs/filters/vue/entries.rb @@ -5,7 +5,11 @@ module Docs if slug == 'api/' 'API' else - at_css('h1').content + name = at_css('.content h1').content + node = at_css(".sidebar .menu-root a[href='#{File.basename(slug)}']") + index = node.parent.parent.css('> li > a').to_a.index(node) + name.prepend "#{index + 1}. " if index + name end end @@ -21,7 +25,7 @@ module Docs return [] if slug.start_with?('guide') type = nil - css('h2, h3').each_with_object [] do |node, entries| + css('.content h2, .content h3').each_with_object [] do |node, entries| if node.name == 'h2' type = node.content.strip else diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index 6872074f..f7bcce71 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -8,9 +8,10 @@ module Docs code: 'https://github.com/vuejs/vue' } - html_filters.push 'vue/clean_html', 'vue/entries' + html_filters.push 'vue/entries', 'vue/clean_html' options[:only_patterns] = [/guide\//, /api\//] + options[:replace_paths] = { 'guide/' => 'guide/index.html' } options[:attribution] = <<-HTML © 2013–2017 Evan You, Vue.js contributors
@@ -18,7 +19,7 @@ module Docs HTML version '2' do - self.release = '2.2.6' + self.release = '2.3.2' self.base_url = 'https://vuejs.org/v2/' self.root_path = 'guide/index.html' self.initial_paths = %w(api/)