Add Vagrant documentation

pull/292/head
Lyubomir Popov 9 years ago committed by Thibaut
parent f879ad0f9c
commit e6c90931d5

@ -0,0 +1,20 @@
module Docs
class Vagrant
class CleanHtmlFilter < Filter
def call
if root_page?
doc.children = css('h1, .category')
return doc
end
css('nav', '.sidebar', 'footer').remove
css('.wrapper', '.page', '.container', '.row', '.page-contents', '.span8').each do |node|
node.before(node.children).remove
end
doc
end
end
end
end

@ -0,0 +1,63 @@
module Docs
class Vagrant
class EntriesFilter < Docs::EntriesFilter
def get_name
if slug.start_with?('push/')
if at_css('h2')
name = at_css('h2').content.strip
else
name = at_css('h1').content.strip
end
name
else
name = at_css('h1').content.strip
name
end
end
def get_type
if slug.start_with?('why-vagrant')
'Why Vagrant?'
elsif slug.start_with?('installation')
'Installation'
elsif slug.start_with?('getting-started')
'Getting Started'
elsif slug.start_with?('cli')
'Command-Line Interface'
elsif slug.start_with?('share')
'Vagrant Share'
elsif slug.start_with?('vagrantfile')
'Vagrantfile'
elsif slug.start_with?('boxes')
'Boxes'
elsif slug.start_with?('provisioning')
'Provisioning'
elsif slug.start_with?('networking')
'Networking'
elsif slug.start_with?('synced-folders')
'Synced Folders'
elsif slug.start_with?('multi-machine')
'Multi-Machine'
elsif slug.start_with?('providers')
'Providers'
elsif slug.start_with?('plugins')
'Plugins'
elsif slug.start_with?('push')
'Push'
elsif slug.start_with?('other')
'Other'
elsif slug.start_with?('vmware')
'VMware'
elsif slug.start_with?('docker')
'Docker'
elsif slug.start_with?('virtualbox')
'VirtualBox'
elsif slug.start_with?('hyperv')
'Hyper-V'
else
'Overview'
end
end
end
end
end

@ -0,0 +1,19 @@
module Docs
class Vagrant < UrlScraper
self.name = 'Vagrant'
self.slug = 'vagrant'
self.type = 'vagrant'
self.version = '1.7.4'
self.base_url = 'http://docs.vagrantup.com/v2/'
self.links = {
home: 'http://www.vagrantup.com/'
}
html_filters.push 'vagrant/clean_html', 'vagrant/entries'
options[:attribution] = <<-HTML
&copy; 2010&ndash;2015 Mitchell Hashimoto<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1 @@
http://www.vagrantup.com
Loading…
Cancel
Save