diff --git a/lib/docs/filters/vagrant/clean_html.rb b/lib/docs/filters/vagrant/clean_html.rb new file mode 100644 index 00000000..30516650 --- /dev/null +++ b/lib/docs/filters/vagrant/clean_html.rb @@ -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 diff --git a/lib/docs/filters/vagrant/entries.rb b/lib/docs/filters/vagrant/entries.rb new file mode 100644 index 00000000..6ff89757 --- /dev/null +++ b/lib/docs/filters/vagrant/entries.rb @@ -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 diff --git a/lib/docs/scrapers/vagrant.rb b/lib/docs/scrapers/vagrant.rb new file mode 100644 index 00000000..c0fc8010 --- /dev/null +++ b/lib/docs/scrapers/vagrant.rb @@ -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 + © 2010–2015 Mitchell Hashimoto
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/vagrant/16.png b/public/icons/docs/vagrant/16.png new file mode 100644 index 00000000..9c111f32 Binary files /dev/null and b/public/icons/docs/vagrant/16.png differ diff --git a/public/icons/docs/vagrant/16@2x.png b/public/icons/docs/vagrant/16@2x.png new file mode 100644 index 00000000..d9425c65 Binary files /dev/null and b/public/icons/docs/vagrant/16@2x.png differ diff --git a/public/icons/docs/vagrant/SOURCE b/public/icons/docs/vagrant/SOURCE new file mode 100644 index 00000000..7c6a05ed --- /dev/null +++ b/public/icons/docs/vagrant/SOURCE @@ -0,0 +1 @@ +http://www.vagrantup.com