Skip to content

Commit 9651af7

Browse files
committed
Update Cordova documentation (5.4.0)
1 parent eb4d9d0 commit 9651af7

3 files changed

Lines changed: 7 additions & 16 deletions

File tree

lib/docs/filters/cordova/clean_html.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ class CleanHtmlFilter < Filter
44
def call
55
if root_page?
66
css('h1').each { |node| node.name = 'h2' }
7-
css('li > h3').each { |node| node.name = 'div' }
8-
elsif slug == 'cordova_events_events.md'
9-
css('h1:not(:first-child)').each { |node| node.name = 'h3' }
10-
css('h2').each { |node| node.name = 'h4' }
7+
css('li > h2').each { |node| node.name = 'div' }
118
end
129

1310
css('hr').remove

lib/docs/filters/cordova/entries.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@ def get_name
66
end
77

88
def get_type
9-
if subpath.start_with?('guide_platforms')
9+
if subpath.start_with?('guide/platforms')
1010
name[/Amazon\ Fire\ OS|Android|BlackBerry|Firefox OS|iOS|Windows/] || 'Platform Guides'
11+
elsif subpath.start_with?('cordova/events')
12+
'Events'
1113
else
1214
'Guides'
1315
end
1416
end
15-
16-
def additional_entries
17-
return [] unless slug == 'cordova_events_events.md'
18-
19-
css('h3').map do |node|
20-
[node.content, node['id'], 'Events']
21-
end
22-
end
2317
end
2418
end
2519
end

lib/docs/scrapers/cordova.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Docs
22
class Cordova < UrlScraper
33
self.name = 'Cordova'
44
self.type = 'cordova'
5-
self.version = '5.1.1'
5+
self.version = '5.4.0'
66
self.base_url = "http://cordova.apache.org/docs/en/#{version}/"
77
self.root_path = 'index.html'
88
self.links = {
@@ -11,10 +11,10 @@ class Cordova < UrlScraper
1111

1212
html_filters.push 'cordova/clean_html', 'cordova/entries', 'title'
1313

14-
options[:container] = ->(filter) { filter.root_page? ? '#home' : '#content' }
14+
options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page-toc-source' }
1515
options[:title] = false
1616
options[:root_title] = 'Apache Cordova'
17-
options[:skip] = %w(_index.html guide_support_index.md.html)
17+
options[:skip] = %w(page_index.html)
1818

1919
options[:attribution] = <<-HTML
2020
&copy; 2012-2015 The Apache Software Foundation<br>

0 commit comments

Comments
 (0)