History

Update Vagrant documentation (1.9.5)

Thibaut Courouble committed 9 years ago

Commit 9b655f21 parent cc4c5d67 files · +21 −23Browse files

Unified · Split

7 files
  1. assets/stylesheets/application-dark.css.scss +0 −1
  2. assets/stylesheets/application.css.scss +0 −1
  3. assets/stylesheets/pages/_simple.scss +1 −0
  4. assets/stylesheets/pages/_vagrant.scss +0 −9
  5. lib/docs/filters/vagrant/clean_html.rb +11 −5
  6. lib/docs/filters/vagrant/entries.rb +8 −6
  7. lib/docs/scrapers/vagrant.rb +1 −1
assets/stylesheets/application-dark.css.scss+0−1
@@ -94,7 +94,6 @@ · 93 unmodified lines
94 'pages/tcl_tk',94 'pages/tcl_tk',
95 'pages/tensorflow',95 'pages/tensorflow',
96 'pages/underscore',96 'pages/underscore',
97 'pages/vagrant',
98 'pages/vue',97 'pages/vue',
99 'pages/webpack',98 'pages/webpack',
100 'pages/yard',99 'pages/yard',
assets/stylesheets/application.css.scss+0−1
@@ -94,7 +94,6 @@ · 93 unmodified lines
94 'pages/tcl_tk',94 'pages/tcl_tk',
95 'pages/tensorflow',95 'pages/tensorflow',
96 'pages/underscore',96 'pages/underscore',
97 'pages/vagrant',
98 'pages/vue',97 'pages/vue',
99 'pages/webpack',98 'pages/webpack',
100 'pages/yard',99 'pages/yard',
assets/stylesheets/pages/_simple.scss+1−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
38._mongoose,38._mongoose,
39._redux,39._redux,
40._typescript,40._typescript,
41._vagrant,
41._yarn {42._yarn {
42 @extend %simple;43 @extend %simple;
43}44}
assets/stylesheets/pages/_vagrant.scss+0−9
@@ -1,9 +0,0 @@
1._vagrant {
2 @extend %simple;
3
4 .alert { @extend %note; }
5 .prev-button { float: left; }
6 .prev-button:before { content: '\2190 '; }
7 .next-button { float: right; }
8 .next-button:after { content: ' \2192'; }
9}
lib/docs/filters/vagrant/clean_html.rb+11−5
@@ -2,13 +2,19 @@ module Docs · 1 unmodified line
2 class Vagrant2 class Vagrant
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 @doc = at_css('#main-content .bs-docs-section')5 @doc = at_css('#inner')
6 6
7 css('hr').remove7 css('hr', 'a.anchor').remove
8 8
9 css('pre > code').each do |node|9 css('.alert').each do |node|
10 node.parent['data-language'] = 'ruby'10 node.name = 'blockquote'
11 node.before(node.children).remove11 end
12
13 css('pre').each do |node|
14 if language = node['class'][/(json|shell|ruby)/, 1]
15 node['data-language'] = language
16 end
17 node.content = node.content
12 end18 end
13 19
14 doc20 doc
lib/docs/filters/vagrant/entries.rb+8−6
@@ -3,12 +3,14 @@ module Docs · 2 unmodified lines
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 def get_name4 def get_name
5 if slug.start_with?('push/')5 if slug.start_with?('push/')
6 name = at_css('#main-content h2').try(:content)6 name = at_css('#inner h2').try(:content)
7 elsif slug.start_with?('cli/')7 elsif slug.start_with?('cli/')
8 name = at_css('#main-content h1 + p > strong > code').try(:content).try(:[], /\s*vagrant\s+[\w\-]+/)8 name = at_css('#inner h1 + p > strong > code').try(:content).try(:[], /\s*vagrant\s+[\w\-]+/)
9 end9 end
10 10
11 name || at_css('#main-content h1').content11 name ||= at_css('#inner h1').content
12 name.remove! "» "
13 name
12 end14 end
13 15
14 def get_type16 def get_type
@@ -22,11 +24,11 @@ module Docs · 7 unmodified lines
22 case at_css('h1 + p > strong > code').try(:content)24 case at_css('h1 + p > strong > code').try(:content)
23 when /config\./25 when /config\./
24 h2 = nil26 h2 = nil
25 css('#main-content .bs-docs-section > *').each_with_object [] do |node, entries|27 css('#inner > *').each_with_object [] do |node, entries|
26 next if node.name == 'pre'28 next if node.name == 'pre'
27 if node.name == 'h2'29 if node.name == 'h2'
28 h2 = node.content30 h2 = node['id']
29 elsif h2 == 'Available Settings' && (code = node.at_css('code')) && (name = code.content) && name.start_with?('config.')31 elsif h2 == 'available-settings' && (code = node.at_css('code')) && (name = code.content) && name.start_with?('config.')
30 id = code.parent['id'] = name.parameterize32 id = code.parent['id'] = name.parameterize
31 entries << [name, id, 'Config']33 entries << [name, id, 'Config']
32 end34 end
lib/docs/scrapers/vagrant.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Vagrant < UrlScraper2 class Vagrant < UrlScraper
3 self.name = 'Vagrant'3 self.name = 'Vagrant'
4 self.type = 'vagrant'4 self.type = 'vagrant'
5 self.release = '1.9.2'5 self.release = '1.9.5'
6 self.base_url = 'https://www.vagrantup.com/docs/'6 self.base_url = 'https://www.vagrantup.com/docs/'
7 self.root_path = 'index.html'7 self.root_path = 'index.html'
8 self.links = {8 self.links = {