History

Update Vue documentation

Fixes #2004.

Simon Legner committed 3 years ago

Commit 61009121 parent 03dfcf52 files · +3 −7Browse files

Unified · Split

2 files
  1. lib/docs/filters/vue/clean_html.rb +2 −7
  2. lib/docs/scrapers/vue.rb +1 −0
lib/docs/filters/vue/clean_html.rb+2−7
@@ -2,13 +2,8 @@ module Docs · 1 unmodified line
2 class Vue2 class Vue
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 if current_url.host == 'vitejs.dev'5 return '<h1>Vue.js</h1>' if root_page?
6 return '<h1>Vite</h1>' if root_page?6 @doc = at_css(version == '3' ? 'main > div > div' : '.content')
7 @doc = at_css('.content > div')
8 else
9 return '<h1>Vue.js</h1>' if root_page?
10 @doc = at_css(version == '3' ? 'main > div > div' : '.content')
11 end
12 7
13 at_css('h1').content = 'Vue.js' if root_page?8 at_css('h1').content = 'Vue.js' if root_page?
14 doc.child.before('<h1>Vue.js API</h1>') if slug == 'api/' || slug == 'api/index'9 doc.child.before('<h1>Vue.js API</h1>') if slug == 'api/' || slug == 'api/index'
lib/docs/scrapers/vue.rb+1−0
@@ -29,6 +29,7 @@ module Docs · 28 unmodified lines
29 self.release = '2.7.14'29 self.release = '2.7.14'
30 self.base_url = 'https://v2.vuejs.org/v2/'30 self.base_url = 'https://v2.vuejs.org/v2/'
31 self.initial_paths = %w(api/)31 self.initial_paths = %w(api/)
32 self.root_path = 'guide/'
32 html_filters.push 'vue/entries', 'vue/clean_html'33 html_filters.push 'vue/entries', 'vue/clean_html'
33 end34 end
34 35