History

Update Vue.js documentation (2.3.2)

Closes #612.

Thibaut Courouble committed 9 years ago

Commit 0e8ab3c1 parent 8e612652 files · +9 −4Browse files

Unified · Split

2 files
  1. lib/docs/filters/vue/entries.rb +6 −2
  2. lib/docs/scrapers/vue.rb +3 −2
lib/docs/filters/vue/entries.rb+6−2
@@ -5,7 +5,11 @@ module Docs · 4 unmodified lines
55 if slug == 'api/'
66 'API'
77 else
8− at_css('h1').content
8+ name = at_css('.content h1').content
9+ node = at_css(".sidebar .menu-root a[href='#{File.basename(slug)}']")
10+ index = node.parent.parent.css('> li > a').to_a.index(node)
11+ name.prepend "#{index + 1}. " if index
12+ name
913 end
1014 end
1115
@@ -21,7 +25,7 @@ module Docs · 9 unmodified lines
2125 return [] if slug.start_with?('guide')
2226 type = nil
2327
24− css('h2, h3').each_with_object [] do |node, entries|
28+ css('.content h2, .content h3').each_with_object [] do |node, entries|
2529 if node.name == 'h2'
2630 type = node.content.strip
2731 else
lib/docs/scrapers/vue.rb+3−2
@@ -8,9 +8,10 @@ module Docs · 7 unmodified lines
88 code: 'https://github.com/vuejs/vue'
99 }
1010
11− html_filters.push 'vue/clean_html', 'vue/entries'
11+ html_filters.push 'vue/entries', 'vue/clean_html'
1212
1313 options[:only_patterns] = [/guide\//, /api\//]
14+ options[:replace_paths] = { 'guide/' => 'guide/index.html' }
1415
1516 options[:attribution] = <<-HTML
1617 &copy; 2013&ndash;2017 Evan You, Vue.js contributors<br>
@@ -18,7 +19,7 @@ module Docs · 1 unmodified line
1819 HTML
1920
2021 version '2' do
21− self.release = '2.2.6'
22+ self.release = '2.3.2'
2223 self.base_url = 'https://vuejs.org/v2/'
2324 self.root_path = 'guide/index.html'
2425 self.initial_paths = %w(api/)