Update Vagrant documentation (1.9.5)

pull/630/head
Thibaut Courouble 8 years ago
parent cc4c5d62a8
commit 9b655f2ee5

@ -94,7 +94,6 @@
'pages/tcl_tk',
'pages/tensorflow',
'pages/underscore',
'pages/vagrant',
'pages/vue',
'pages/webpack',
'pages/yard',

@ -94,7 +94,6 @@
'pages/tcl_tk',
'pages/tensorflow',
'pages/underscore',
'pages/vagrant',
'pages/vue',
'pages/webpack',
'pages/yard',

@ -38,6 +38,7 @@
._mongoose,
._redux,
._typescript,
._vagrant,
._yarn {
@extend %simple;
}

@ -1,9 +0,0 @@
._vagrant {
@extend %simple;
.alert { @extend %note; }
.prev-button { float: left; }
.prev-button:before { content: '\2190 '; }
.next-button { float: right; }
.next-button:after { content: ' \2192'; }
}

@ -2,13 +2,19 @@ module Docs
class Vagrant
class CleanHtmlFilter < Filter
def call
@doc = at_css('#main-content .bs-docs-section')
@doc = at_css('#inner')
css('hr').remove
css('hr', 'a.anchor').remove
css('pre > code').each do |node|
node.parent['data-language'] = 'ruby'
node.before(node.children).remove
css('.alert').each do |node|
node.name = 'blockquote'
end
css('pre').each do |node|
if language = node['class'][/(json|shell|ruby)/, 1]
node['data-language'] = language
end
node.content = node.content
end
doc

@ -3,12 +3,14 @@ module Docs
class EntriesFilter < Docs::EntriesFilter
def get_name
if slug.start_with?('push/')
name = at_css('#main-content h2').try(:content)
name = at_css('#inner h2').try(:content)
elsif slug.start_with?('cli/')
name = at_css('#main-content h1 + p > strong > code').try(:content).try(:[], /\s*vagrant\s+[\w\-]+/)
name = at_css('#inner h1 + p > strong > code').try(:content).try(:[], /\s*vagrant\s+[\w\-]+/)
end
name || at_css('#main-content h1').content
name ||= at_css('#inner h1').content
name.remove! "» "
name
end
def get_type
@ -22,11 +24,11 @@ module Docs
case at_css('h1 + p > strong > code').try(:content)
when /config\./
h2 = nil
css('#main-content .bs-docs-section > *').each_with_object [] do |node, entries|
css('#inner > *').each_with_object [] do |node, entries|
next if node.name == 'pre'
if node.name == 'h2'
h2 = node.content
elsif h2 == 'Available Settings' && (code = node.at_css('code')) && (name = code.content) && name.start_with?('config.')
h2 = node['id']
elsif h2 == 'available-settings' && (code = node.at_css('code')) && (name = code.content) && name.start_with?('config.')
id = code.parent['id'] = name.parameterize
entries << [name, id, 'Config']
end

@ -2,7 +2,7 @@ module Docs
class Vagrant < UrlScraper
self.name = 'Vagrant'
self.type = 'vagrant'
self.release = '1.9.2'
self.release = '1.9.5'
self.base_url = 'https://www.vagrantup.com/docs/'
self.root_path = 'index.html'
self.links = {

Loading…
Cancel
Save