Update Vue.js documentation (3.2.30)

https://blog.vuejs.org/posts/vue-3-as-the-new-default.html
pull/1704/head
Simon Legner 3 years ago
parent bb78302881
commit 6faab8bcc8

@ -6,7 +6,8 @@ module Docs
return '<h1>Vite</h1>' if root_page?
@doc = at_css('.content > div')
else
@doc = at_css(version == '3' ? 'main' : '.content')
return '<h1>Vue.js</h1>' if root_page?
@doc = at_css(version == '3' ? 'main > div > div' : '.content')
end
at_css('h1').content = 'Vue.js' if root_page?
@ -14,6 +15,7 @@ module Docs
css('.demo', '.guide-links', '.footer', '#ad').remove
css('.header-anchor', '.page-edit', '.page-nav').remove
css('.next-steps').remove
css('.custom-block-title').each do |node|
node.name = 'strong'

@ -9,9 +9,9 @@ module Docs
else
name = at_css('h1').content
name = _fix_name(name)
subtype = at_css('.sidebar-heading.open, .sidebar-heading.active, .sidebar-link.active')
index = css('.sidebar-link').to_a.index(at_css('.sidebar-link.active'))
name.prepend "#{index + 1}. " if index && !slug.start_with?('api')
subtype = at_css('.title-text.active')
index = css('aside nav .link').to_a.index(at_css('aside nav .link.active'))
name.prepend "#{index + 1}. " if index && !slug.start_with?('api') && !slug.start_with?('style-guide')
name.concat " (#{subtype.content.strip})" if subtype && slug.start_with?('guide')
name
end
@ -26,12 +26,12 @@ module Docs
def get_type
if slug.start_with?('guide/migration')
'Migration'
elsif slug.start_with?('guide')
elsif slug.start_with?('guide') or root_page?
'Guide'
elsif slug == 'style-guide/'
elsif slug.start_with?('style-guide')
'Style Guide'
else
title = at_css('.sidebar-heading.open, .sidebar-heading.active, .sidebar-link.active').content.strip
title = at_css('.title-text.active').content.strip
title = _fix_name(title)
"API: #{title}"
end
@ -41,7 +41,7 @@ module Docs
return [] if slug.start_with?('guide')
type = nil
css('h2, h3').each_with_object [] do |node, entries|
at_css('main').css('h2, h3').each_with_object [] do |node, entries|
if node.name == 'h2'
type = node.content.strip
type = _fix_name(type)

@ -5,10 +5,10 @@ module Docs
self.type = 'vue'
self.links = {
home: 'https://vuejs.org/',
code: 'https://github.com/vuejs/vue'
code: 'https://github.com/vuejs/core'
}
options[:only_patterns] = [/guide\//, /api\//]
options[:only_patterns] = [/^$/ ,/guide\//, /api\//]
options[:skip] = %w(guide/team.html)
options[:skip_patterns] = [/guide\/contributing/]
options[:replace_paths] = { 'guide/' => 'guide/index.html' }
@ -19,16 +19,15 @@ module Docs
HTML
version '3' do
self.release = '3.2.26'
self.base_url = 'https://v3.vuejs.org/'
self.root_path = 'guide/introduction.html'
self.initial_paths = %w(api/)
self.release = '3.2.30'
self.base_url = 'https://vuejs.org/'
self.initial_paths = %w(guide/introduction.html)
html_filters.push 'vue/entries_v3', 'vue/clean_html'
end
version '2' do
self.release = '2.6.12'
self.base_url = 'https://vuejs.org/v2/'
self.base_url = 'https://v2.vuejs.org/'
self.root_path = 'guide/index.html'
self.initial_paths = %w(api/)
html_filters.push 'vue/entries', 'vue/clean_html'
@ -43,7 +42,7 @@ module Docs
end
def get_latest_version(opts)
get_npm_version('vue', opts, 'next')
get_npm_version('vue', opts)
end
end
end

Loading…
Cancel
Save