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
4 def call4 def call
5 if root_page?5 if root_page?
6 css('h1').each { |node| node.name = 'h2' }6 css('h1').each { |node| node.name = 'h2' }
7 css('li > h3').each { |node| node.name = 'div' }7 css('li > h2').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' }
11 end8 end
12 9
13 css('hr').remove10 css('hr').remove
lib/docs/filters/cordova/entries.rb+3−9
@@ -6,20 +6,14 @@ module Docs · 5 unmodified lines
6 end6 end
7 7
8 def get_type8 def get_type
9 if subpath.start_with?('guide_platforms')9 if subpath.start_with?('guide/platforms')
10 name[/Amazon\ Fire\ OS|Android|BlackBerry|Firefox OS|iOS|Windows/] || 'Platform Guides'10 name[/Amazon\ Fire\ OS|Android|BlackBerry|Firefox OS|iOS|Windows/] || 'Platform Guides'
11 elsif subpath.start_with?('cordova/events')
12 'Events'
11 else13 else
12 'Guides'14 'Guides'
13 end15 end
14 end16 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
23 end17 end
24 end18 end
25end19end
lib/docs/scrapers/cordova.rb+3−3
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Cordova < UrlScraper2 class Cordova < UrlScraper
3 self.name = 'Cordova'3 self.name = 'Cordova'
4 self.type = 'cordova'4 self.type = 'cordova'
5 self.version = '5.1.1'5 self.version = '5.4.0'
6 self.base_url = "http://cordova.apache.org/docs/en/#{version}/"6 self.base_url = "http://cordova.apache.org/docs/en/#{version}/"
7 self.root_path = 'index.html'7 self.root_path = 'index.html'
8 self.links = {8 self.links = {
@@ -11,10 +11,10 @@ module Docs · 2 unmodified lines
11 11
12 html_filters.push 'cordova/clean_html', 'cordova/entries', 'title'12 html_filters.push 'cordova/clean_html', 'cordova/entries', 'title'
13 13
14 options[:container] = ->(filter) { filter.root_page? ? '#home' : '#content' }14 options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page-toc-source' }
15 options[:title] = false15 options[:title] = false
16 options[:root_title] = 'Apache Cordova'16 options[:root_title] = 'Apache Cordova'
17 options[:skip] = %w(_index.html guide_support_index.md.html)17 options[:skip] = %w(page_index.html)
18 18
19 options[:attribution] = <<-HTML19 options[:attribution] = <<-HTML
20 &copy; 2012-2015 The Apache Software Foundation<br>20 &copy; 2012-2015 The Apache Software Foundation<br>