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
5 if slug == 'api/'5 if slug == 'api/'
6 'API'6 'API'
7 else7 else
8 at_css('h1').content8 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
9 end13 end
10 end14 end
11 15
@@ -21,7 +25,7 @@ module Docs · 9 unmodified lines
21 return [] if slug.start_with?('guide')25 return [] if slug.start_with?('guide')
22 type = nil26 type = nil
23 27
24 css('h2, h3').each_with_object [] do |node, entries|28 css('.content h2, .content h3').each_with_object [] do |node, entries|
25 if node.name == 'h2'29 if node.name == 'h2'
26 type = node.content.strip30 type = node.content.strip
27 else31 else
lib/docs/scrapers/vue.rb+3−2
@@ -8,9 +8,10 @@ module Docs · 7 unmodified lines
8 code: 'https://github.com/vuejs/vue'8 code: 'https://github.com/vuejs/vue'
9 }9 }
10 10
11 html_filters.push 'vue/clean_html', 'vue/entries'11 html_filters.push 'vue/entries', 'vue/clean_html'
12 12
13 options[:only_patterns] = [/guide\//, /api\//]13 options[:only_patterns] = [/guide\//, /api\//]
14 options[:replace_paths] = { 'guide/' => 'guide/index.html' }
14 15
15 options[:attribution] = <<-HTML16 options[:attribution] = <<-HTML
16 &copy; 2013&ndash;2017 Evan You, Vue.js contributors<br>17 &copy; 2013&ndash;2017 Evan You, Vue.js contributors<br>
@@ -18,7 +19,7 @@ module Docs · 1 unmodified line
18 HTML19 HTML
19 20
20 version '2' do21 version '2' do
21 self.release = '2.2.6'22 self.release = '2.3.2'
22 self.base_url = 'https://vuejs.org/v2/'23 self.base_url = 'https://vuejs.org/v2/'
23 self.root_path = 'guide/index.html'24 self.root_path = 'guide/index.html'
24 self.initial_paths = %w(api/)25 self.initial_paths = %w(api/)