mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Add Cordova documentation
This commit is contained in:
parent
63715a31f9
commit
405e263172
13 changed files with 103 additions and 2 deletions
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Binary file not shown.
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 55 KiB |
|
@ -100,6 +100,11 @@ credits = [
|
|||
'2009-2014 Jeremy Ashkenas',
|
||||
'MIT',
|
||||
'https://raw.github.com/jashkenas/coffee-script/master/LICENSE'
|
||||
], [
|
||||
'Cordova',
|
||||
'2012 The Apache Software Foundation',
|
||||
'Apache',
|
||||
'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE'
|
||||
], [
|
||||
'CSS<br>DOM<br>HTML<br>JavaScript',
|
||||
'2005-2013 Mozilla Developer Network and individual contributors',
|
||||
|
|
|
@ -24,7 +24,10 @@ newsItem = (date, news) ->
|
|||
result
|
||||
|
||||
app.news = [
|
||||
[ 1404172800000, # July 1, 2014
|
||||
[ 1404518400000, # July 5, 2014
|
||||
""" New <a href="/cordova/">Cordova</a> documentation """,
|
||||
], [
|
||||
1404172800000, # July 1, 2014
|
||||
""" New <a href="/chai/">Chai</a> and <a href="/sinon/">Sinon</a> documentations """,
|
||||
], [
|
||||
1402790400000, # June 15, 2014
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
'pages/c',
|
||||
'pages/chai',
|
||||
'pages/coffeescript',
|
||||
'pages/cordova',
|
||||
'pages/d3',
|
||||
'pages/ember',
|
||||
'pages/express',
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
width: 1rem;
|
||||
height: 1rem;
|
||||
background-image: image-url('icons.png');
|
||||
background-size: 5rem 10rem;
|
||||
background-size: 5rem 11rem;
|
||||
}
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
|
||||
|
@ -61,3 +61,4 @@
|
|||
._icon-requirejs:before { background-position: -2rem -9rem; }
|
||||
._icon-chai:before { background-position: -3rem -9rem; }
|
||||
._icon-sinon:before { background-position: -4rem -9rem; }
|
||||
._icon-cordova:before { background-position: 0 -10rem; }
|
||||
|
|
10
assets/stylesheets/pages/_cordova.scss
Normal file
10
assets/stylesheets/pages/_cordova.scss
Normal file
|
@ -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; }
|
||||
}
|
34
lib/docs/filters/cordova/clean_html.rb
Normal file
34
lib/docs/filters/cordova/clean_html.rb
Normal file
|
@ -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
|
25
lib/docs/filters/cordova/entries.rb
Normal file
25
lib/docs/filters/cordova/entries.rb
Normal file
|
@ -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
|
21
lib/docs/scrapers/cordova.rb
Normal file
21
lib/docs/scrapers/cordova.rb
Normal file
|
@ -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
|
BIN
public/icons/docs/cordova/16.png
Normal file
BIN
public/icons/docs/cordova/16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 775 B |
BIN
public/icons/docs/cordova/16@2x.png
Normal file
BIN
public/icons/docs/cordova/16@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
1
public/icons/docs/cordova/SOURCE
Normal file
1
public/icons/docs/cordova/SOURCE
Normal file
|
@ -0,0 +1 @@
|
|||
http://cordova.apache.org/artwork.html
|
Loading…
Reference in a new issue