History

Update Cordova documentation (5.4.0)

Thibaut committed 10 years ago

Commit 9651af71 parent eb4d9d03 files · +7 −16Browse files

Unified · Split

3 files
  1. lib/docs/filters/cordova/clean_html.rb +1 −4
  2. lib/docs/filters/cordova/entries.rb +3 −9
  3. lib/docs/scrapers/cordova.rb +3 −3
lib/docs/filters/cordova/clean_html.rb+1−4
@@ -4,10 +4,7 @@ module Docs · 3 unmodified lines
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+3−9
@@ -6,20 +6,14 @@ module Docs · 5 unmodified lines
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+3−3
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
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 @@ module Docs · 2 unmodified lines
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>