Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | 3 | "2015-11-08", |
| 4 | − "New documentation: <a href=\"/elixir/\">Elixir</a>" | |
| 4 | + "New documentations: <a href=\"/elixir/\">Elixir</a> and <a href=\"/vagrant/\">Vagrant</a>" | |
| 5 | 5 | ], [ |
| 6 | 6 | "2015-10-18", |
| 7 | 7 | "Added a \"Copy to clipboard\" button inside each code block." |
| @@ -379,6 +379,11 @@ credits = [ · 378 unmodified lines | ||
| 379 | 379 | '2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', |
| 380 | 380 | 'MIT', |
| 381 | 381 | 'https://raw.github.com/jashkenas/underscore/master/LICENSE' |
| 382 | + ], [ | |
| 383 | + 'Vagrant', | |
| 384 | + '2010-2015 Mitchell Hashimoto', | |
| 385 | + 'MIT', | |
| 386 | + 'https://raw.githubusercontent.com/mitchellh/vagrant/master/LICENSE' | |
| 382 | 387 | ], [ |
| 383 | 388 | 'Vue.js', |
| 384 | 389 | '2013-2015 Evan You, Vue.js contributors', |
| @@ -0,0 +1,5 @@ | ||
| 1 | +#= require views/pages/base | |
| 2 | + | |
| 3 | +class app.views.VagrantPage extends app.views.BasePage | |
| 4 | + prepare: -> | |
| 5 | + @highlightCode @findAll('pre.ruby'), 'ruby' | |
| @@ -72,6 +72,7 @@ · 71 unmodified lines | ||
| 72 | 72 | 'pages/socketio', |
| 73 | 73 | 'pages/sphinx', |
| 74 | 74 | 'pages/underscore', |
| 75 | + 'pages/vagrant', | |
| 75 | 76 | 'pages/vue', |
| 76 | 77 | 'pages/yard', |
| 77 | 78 | 'pages/yii'; |
| @@ -72,6 +72,7 @@ · 71 unmodified lines | ||
| 72 | 72 | 'pages/socketio', |
| 73 | 73 | 'pages/sphinx', |
| 74 | 74 | 'pages/underscore', |
| 75 | + 'pages/vagrant', | |
| 75 | 76 | 'pages/vue', |
| 76 | 77 | 'pages/yard', |
| 77 | 78 | 'pages/yii'; |
| @@ -117,3 +117,4 @@ · 116 unmodified lines | ||
| 117 | 117 | %icon-clipboard { background-position: -2rem -9rem; } |
| 118 | 118 | %icon-clipboard-white { background-position: -3rem -9rem; } |
| 119 | 119 | ._icon-elixir:before { background-position: -4rem -9rem; @extend %darkIconFix !optional; } |
| 120 | +._icon-vagrant:before { background-position: -5rem -9rem; } | |
| @@ -0,0 +1,9 @@ | ||
| 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,14 +2,12 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Vagrant |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − if root_page? | |
| 6 | − doc.children = css('h1, .category') | |
| 7 | − return doc | |
| 8 | − end | |
| 5 | + @doc = at_css('.page-contents .span8') | |
| 9 | 6 | |
| 10 | − css('nav', '.sidebar', 'footer').remove | |
| 7 | + css('hr').remove | |
| 11 | 8 | |
| 12 | − css('.wrapper', '.page', '.container', '.row', '.page-contents', '.span8').each do |node| | |
| 9 | + css('pre > code').each do |node| | |
| 10 | + node.parent['class'] = node['class'] | |
| 13 | 11 | node.before(node.children).remove |
| 14 | 12 | end |
| 15 | 13 | |
| @@ -3,59 +3,32 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_name |
| 5 | 5 | if slug.start_with?('push/') |
| 6 | − if at_css('h2') | |
| 7 | − name = at_css('h2').content.strip | |
| 8 | − else | |
| 9 | − name = at_css('h1').content.strip | |
| 10 | − end | |
| 11 | − name | |
| 12 | − else | |
| 13 | − name = at_css('h1').content.strip | |
| 14 | − name | |
| 6 | + name = at_css('h2').try(:content) | |
| 7 | + elsif slug.start_with?('cli/') | |
| 8 | + name = at_css('h1 + p > strong > code').try(:content).try(:[], /\s*vagrant\s+[\w\-]+/) | |
| 15 | 9 | end |
| 10 | + | |
| 11 | + name || at_css('h1').content | |
| 16 | 12 | end |
| 17 | 13 | |
| 18 | 14 | def get_type |
| 19 | − if slug.start_with?('why-vagrant') | |
| 20 | − 'Why Vagrant?' | |
| 21 | − elsif slug.start_with?('installation') | |
| 22 | − 'Installation' | |
| 23 | − elsif slug.start_with?('getting-started') | |
| 24 | − 'Getting Started' | |
| 25 | − elsif slug.start_with?('cli') | |
| 26 | − 'Command-Line Interface' | |
| 27 | − elsif slug.start_with?('share') | |
| 28 | − 'Vagrant Share' | |
| 29 | − elsif slug.start_with?('vagrantfile') | |
| 30 | − 'Vagrantfile' | |
| 31 | − elsif slug.start_with?('boxes') | |
| 32 | − 'Boxes' | |
| 33 | − elsif slug.start_with?('provisioning') | |
| 34 | − 'Provisioning' | |
| 35 | − elsif slug.start_with?('networking') | |
| 36 | − 'Networking' | |
| 37 | − elsif slug.start_with?('synced-folders') | |
| 38 | − 'Synced Folders' | |
| 39 | − elsif slug.start_with?('multi-machine') | |
| 40 | − 'Multi-Machine' | |
| 41 | − elsif slug.start_with?('providers') | |
| 42 | − 'Providers' | |
| 43 | − elsif slug.start_with?('plugins') | |
| 44 | − 'Plugins' | |
| 45 | − elsif slug.start_with?('push') | |
| 46 | − 'Push' | |
| 47 | − elsif slug.start_with?('other') | |
| 48 | − 'Other' | |
| 49 | − elsif slug.start_with?('vmware') | |
| 50 | − 'VMware' | |
| 51 | − elsif slug.start_with?('docker') | |
| 52 | − 'Docker' | |
| 53 | − elsif slug.start_with?('virtualbox') | |
| 54 | − 'VirtualBox' | |
| 55 | − elsif slug.start_with?('hyperv') | |
| 56 | − 'Hyper-V' | |
| 15 | + at_css('.sidebar-nav li.current').content | |
| 16 | + end | |
| 17 | + | |
| 18 | + def additional_entries | |
| 19 | + case at_css('h1 + p > strong > code').try(:content) | |
| 20 | + when /config\./ | |
| 21 | + h2 = nil | |
| 22 | + css('.page-contents .span8 > *').each_with_object [] do |node, entries| | |
| 23 | + if node.name == 'h2' | |
| 24 | + h2 = node.content | |
| 25 | + elsif h2 == 'Available Settings' && (code = node.at_css('code')) && (name = code.content) && name.start_with?('config.') | |
| 26 | + id = code.parent['id'] = name.parameterize | |
| 27 | + entries << [name, id, 'Config'] | |
| 28 | + end | |
| 29 | + end | |
| 57 | 30 | else |
| 58 | − 'Overview' | |
| 31 | + [] | |
| 59 | 32 | end |
| 60 | 33 | end |
| 61 | 34 | end |
| @@ -1,15 +1,15 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Vagrant < UrlScraper |
| 3 | 3 | self.name = 'Vagrant' |
| 4 | − self.slug = 'vagrant' | |
| 5 | 4 | self.type = 'vagrant' |
| 6 | 5 | self.version = '1.7.4' |
| 7 | − self.base_url = 'http://docs.vagrantup.com/v2/' | |
| 6 | + self.base_url = 'https://docs.vagrantup.com/v2/' | |
| 8 | 7 | self.links = { |
| 9 | − home: 'http://www.vagrantup.com/' | |
| 8 | + home: 'https://www.vagrantup.com/', | |
| 9 | + code: 'https://github.com/mitchellh/vagrant' | |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | − html_filters.push 'vagrant/clean_html', 'vagrant/entries' | |
| 12 | + html_filters.push 'vagrant/entries', 'vagrant/clean_html' | |
| 13 | 13 | |
| 14 | 14 | options[:attribution] = <<-HTML |
| 15 | 15 | © 2010–2015 Mitchell Hashimoto<br> |
Binary file not shown.
Binary file not shown.