Add back Ansible 2.4 version + improve scraper

pull/813/merge
Thibaut Courouble 7 years ago
parent bb36df7085
commit bcb5445452

@ -10,6 +10,7 @@
.important { @extend %note-orange; }
.warning, .deprecated-removed, .deprecated { @extend %note-red; }
.hint { @extend %note-green; }
.versionmodified, span.title, .topic-title {
display: block;

@ -4,6 +4,10 @@ module Docs
def call
@doc = at_css('#page-content')
css('font').each do |node|
node.before(node.children).remove
end
doc
end
end

@ -11,6 +11,16 @@ module Docs
end
def get_type
if version == '2.4'
if slug.include?('module')
if name =~ /\A[a-z]/ && node = css('.toctree-l2.current').last
return "Modules: #{node.content.remove(' Modules')}"
else
return 'Modules'
end
end
end
if slug =~ /\Acli\//
'CLI Reference'
elsif slug =~ /\Anetwork\//
@ -23,9 +33,9 @@ module Docs
end
elsif slug =~ /\Amodules\//
if slug =~ /\Amodules\/list_/ || slug=~ /_maintained\z/
'Modules'
'Modules: Categories'
else
'Modules: Index'
'Modules'
end
elsif slug.include?('playbook')
'Playbooks'

@ -9,6 +9,16 @@ module Docs
html_filters.push 'ansible/entries', 'sphinx/clean_html', 'ansible/clean_html'
options[:attribution] = <<-HTML
&copy; 2012&ndash;2018 Michael DeHaan<br>
&copy; 2018 Red Hat, Inc.<br>
Licensed under the GNU General Public License version 3.
HTML
version '2.5' do
self.release = '2.5.3'
self.base_url = 'https://docs.ansible.com/ansible/2.5/'
options[:skip] = %w(
installation_guide/index.html
reference_appendices/glossary.html
@ -23,16 +33,19 @@ module Docs
/\Adev_guide.*/i,
/\Aroadmap.*/i,
]
end
options[:attribution] = <<-HTML
&copy; 2012&ndash;2018 Michael DeHaan<br>
&copy; 2018 Red Hat, Inc.<br>
Licensed under the GNU General Public License version 3.
HTML
version '2.4' do
self.release = '2.4.3'
self.base_url = 'https://docs.ansible.com/ansible/2.4/'
version '2.5' do
self.release = '2.5.3'
self.base_url = 'https://docs.ansible.com/ansible/2.5/'
options[:skip] = %w(
glossary.html
faq.html
community.html
tower.html
quickstart.html
list_of_all_modules.html)
end
end
end

Loading…
Cancel
Save