mirror of https://github.com/freeCodeCamp/devdocs
parent
63715a31f9
commit
405e263172
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 55 KiB |
@ -0,0 +1,10 @@
|
||||
._cordova {
|
||||
padding-left: 1rem;
|
||||
|
||||
> h1, > h2 { margin-left: -1rem; }
|
||||
> h2 { @extend %block-heading; }
|
||||
> h3 { font-size: 1rem; }
|
||||
|
||||
code { @extend %label; }
|
||||
blockquote { @extend %note; }
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
module Docs
|
||||
class Cordova
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
if root_page? || slug == 'cordova_events_events.md'
|
||||
css('h1, h2').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i + 1 }
|
||||
end
|
||||
at_css('h2').name = 'h1' if slug == 'cordova_events_events.md'
|
||||
end
|
||||
|
||||
if root_page?
|
||||
css('li > h3').each do |node|
|
||||
node.name = 'div'
|
||||
end
|
||||
end
|
||||
|
||||
css('hr').remove
|
||||
|
||||
css('a[name]').each do |node|
|
||||
node.parent['id'] = node['name']
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
# Remove code highlighting
|
||||
css('pre').each do |node|
|
||||
node.content = node.content.remove(/^\ {4,5}/)
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,25 @@
|
||||
module Docs
|
||||
class Cordova
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
at_css('h1').content.remove(' Guide')
|
||||
end
|
||||
|
||||
def get_type
|
||||
if subpath.start_with?('guide_platforms')
|
||||
name[/Amazon\ Fire\ OS|Android|BlackBerry|Firefox OS|iOS|Windows/] || 'Platform Guides'
|
||||
else
|
||||
'Guides'
|
||||
end
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
return [] unless slug == 'cordova_events_events.md'
|
||||
|
||||
css('h2').map do |node|
|
||||
[node.content, node['id'], 'Events']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
module Docs
|
||||
class Cordova < UrlScraper
|
||||
self.name = 'Cordova'
|
||||
self.type = 'cordova'
|
||||
self.version = '3.5.0'
|
||||
self.base_url = 'http://cordova.apache.org/docs/en/3.5.0/'
|
||||
self.root_path = 'index.html'
|
||||
|
||||
html_filters.push 'cordova/clean_html', 'cordova/entries', 'title'
|
||||
|
||||
options[:container] = ->(filter) { filter.root_page? ? '#home' : '#content' }
|
||||
options[:title] = false
|
||||
options[:root_title] = 'Apache Cordova'
|
||||
options[:skip] = %w(_index.html guide_support_index.md.html)
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2012 The Apache Software Foundation<br>
|
||||
Licensed under the Apache License 2.0.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1 @@
|
||||
http://cordova.apache.org/artwork.html
|
Loading…
Reference in new issue