Unified · Split
| @@ -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', |
| @@ -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', |
| @@ -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 | } |
| @@ -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 | } | ||
| @@ -2,13 +2,19 @@ module Docs · 1 unmodified line | |||
| 2 | class Vagrant | 2 | class Vagrant |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | @doc = at_css('#main-content .bs-docs-section') | 5 | @doc = at_css('#inner') |
| 6 | 6 | ||
| 7 | css('hr').remove | 7 | 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).remove | 11 | 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 | end | 18 | end |
| 13 | 19 | ||
| 14 | doc | 20 | doc |
| @@ -3,12 +3,14 @@ module Docs · 2 unmodified lines | |||
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | 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 | end | 9 | end |
| 10 | 10 | ||
| 11 | name || at_css('#main-content h1').content | 11 | name ||= at_css('#inner h1').content |
| 12 | name.remove! "» " | ||
| 13 | name | ||
| 12 | end | 14 | end |
| 13 | 15 | ||
| 14 | def get_type | 16 | 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 = nil | 26 | 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.content | 30 | 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.parameterize | 32 | id = code.parent['id'] = name.parameterize |
| 31 | entries << [name, id, 'Config'] | 33 | entries << [name, id, 'Config'] |
| 32 | end | 34 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Vagrant < UrlScraper | 2 | 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 = { |