diff --git a/lib/docs/filters/cordova/clean_html.rb b/lib/docs/filters/cordova/clean_html.rb index 0f3eb0d1..01443ec3 100644 --- a/lib/docs/filters/cordova/clean_html.rb +++ b/lib/docs/filters/cordova/clean_html.rb @@ -4,10 +4,7 @@ module Docs def call if root_page? css('h1').each { |node| node.name = 'h2' } - css('li > h3').each { |node| node.name = 'div' } - elsif slug == 'cordova_events_events.md' - css('h1:not(:first-child)').each { |node| node.name = 'h3' } - css('h2').each { |node| node.name = 'h4' } + css('li > h2').each { |node| node.name = 'div' } end css('hr').remove diff --git a/lib/docs/filters/cordova/entries.rb b/lib/docs/filters/cordova/entries.rb index 9843853d..86800cc5 100644 --- a/lib/docs/filters/cordova/entries.rb +++ b/lib/docs/filters/cordova/entries.rb @@ -6,20 +6,14 @@ module Docs end def get_type - if subpath.start_with?('guide_platforms') + if subpath.start_with?('guide/platforms') name[/Amazon\ Fire\ OS|Android|BlackBerry|Firefox OS|iOS|Windows/] || 'Platform Guides' + elsif subpath.start_with?('cordova/events') + 'Events' else 'Guides' end end - - def additional_entries - return [] unless slug == 'cordova_events_events.md' - - css('h3').map do |node| - [node.content, node['id'], 'Events'] - end - end end end end diff --git a/lib/docs/scrapers/cordova.rb b/lib/docs/scrapers/cordova.rb index 3331c4b1..f1dfa17c 100644 --- a/lib/docs/scrapers/cordova.rb +++ b/lib/docs/scrapers/cordova.rb @@ -2,7 +2,7 @@ module Docs class Cordova < UrlScraper self.name = 'Cordova' self.type = 'cordova' - self.version = '5.1.1' + self.version = '5.4.0' self.base_url = "http://cordova.apache.org/docs/en/#{version}/" self.root_path = 'index.html' self.links = { @@ -11,10 +11,10 @@ module Docs html_filters.push 'cordova/clean_html', 'cordova/entries', 'title' - options[:container] = ->(filter) { filter.root_page? ? '#home' : '#content' } + options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page-toc-source' } options[:title] = false options[:root_title] = 'Apache Cordova' - options[:skip] = %w(_index.html guide_support_index.md.html) + options[:skip] = %w(page_index.html) options[:attribution] = <<-HTML © 2012-2015 The Apache Software Foundation<br>