History

Add Async documentation

Thibaut Courouble committed 9 years ago

Commit 6e43cfe1 parent a0cfe4515 files · +95 −-3Browse files

Unified · Split

15 files
  1. assets/images/docs.png +0 −0
  2. assets/images/docs@2x.png +0 −0
  3. assets/javascripts/news.json +1 −1
  4. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  5. assets/javascripts/views/pages/simple.coffee +1 −0
  6. assets/stylesheets/application-dark.css.scss +1 −0
  7. assets/stylesheets/application.css.scss +1 −0
  8. assets/stylesheets/global/_icons.scss +1 −0
  9. assets/stylesheets/pages/_async.scss +15 −0
  10. lib/docs/filters/async/clean_html.rb +30 −0
  11. lib/docs/filters/async/entries.rb +22 −0
  12. lib/docs/scrapers/async.rb +21 −0
  13. public/icons/docs/async/16.png +0 −0
  14. public/icons/docs/async/16@2x.png +0 −0
  15. public/icons/docs/async/SOURCE +1 −0
assets/images/docs.png+0−0

Binary file not shown.

assets/images/docs@2x.png+0−0

Binary file not shown.

assets/javascripts/news.json+1−1
@@ -1,7 +1,7 @@
11 [
22 [
33 "2016-11-20",
4− "New documentations: <a href=\"/yarn/\">Yarn</a> and <a href=\"/immutable/\">Immutable.js</a>"
4+ "New documentations: <a href=\"/yarn/\">Yarn</a>, <a href=\"/immutable/\">Immutable.js</a> and <a href=\"/async/\">Async</a>"
55 ], [
66 "2016-10-10",
77 "New documentations: <a href=\"/scikit_learn/\">scikit-learn</a> and <a href=\"/statsmodels/\">Statsmodels</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -99,6 +99,11 @@ credits = [ · 98 unmodified lines
9999 '2016 The Apache Software Foundation<br>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.',
100100 'Apache',
101101 'https://www.apache.org/licenses/LICENSE-2.0'
102+ ], [
103+ 'Async',
104+ '2010-2016 Caolan McMahon',
105+ 'MIT',
106+ 'https://raw.githubusercontent.com/caolan/async/master/LICENSE'
102107 ], [
103108 'Backbone.js',
104109 '2010-2016 Jeremy Ashkenas, DocumentCloud',
assets/javascripts/views/pages/simple.coffee+1−0
@@ -8,6 +8,7 @@ class app.views.SimplePage extends app.views.BasePage · 7 unmodified lines
88
99 app.views.AngularPage =
1010 app.views.AngularjsPage =
11+app.views.AsyncPage =
1112 app.views.BootstrapPage =
1213 app.views.BowerPage =
1314 app.views.CPage =
assets/stylesheets/application-dark.css.scss+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 'pages/angular',
3535 'pages/angularjs',
3636 'pages/apache',
37+ 'pages/async',
3738 'pages/bootstrap',
3839 'pages/c',
3940 'pages/cakephp',
assets/stylesheets/application.css.scss+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 'pages/angular',
3535 'pages/angularjs',
3636 'pages/apache',
37+ 'pages/async',
3738 'pages/bootstrap',
3839 'pages/c',
3940 'pages/cakephp',
assets/stylesheets/global/_icons.scss+1−0
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 %icon-close-white { background-position: -2rem -5rem; }
5757 %icon-back { background-position: -3rem -5rem; @extend %darkIconFix !optional; }
5858
59+._icon-async:before { background-position: -6rem 0; @extend %darkIconFix !optional; }
5960 ._icon-http:before { background-position: -7rem 0; @extend %darkIconFix !optional; }
6061 ._icon-jquery:before { background-position: -8rem 0; @extend %darkIconFix !optional; }
6162 ._icon-underscore:before { background-position: -9rem 0; @extend %darkIconFix !optional; }
assets/stylesheets/pages/_async.scss+15−0
@@ -0,0 +1,15 @@
1+._async {
2+ @extend %simple;
3+
4+ h3 > .type-signature {
5+ float: right;
6+ color: $textColorLight;
7+ }
8+
9+ h3 > .signature-attributes {
10+ font-size: .75rem;
11+ font-weight: normal;
12+ font-style: italic;
13+ color: $textColorLighter;
14+ }
15+}
lib/docs/filters/async/clean_html.rb+30−0
@@ -0,0 +1,30 @@
1+module Docs
2+ class Async
3+ class CleanHtmlFilter < Filter
4+ def call
5+ @doc = at_css('#main-container')
6+
7+ at_css('footer').remove
8+
9+ css('section', 'header', 'article', '.container-overview', 'span.signature', 'div.description').each do |node|
10+ node.before(node.children).remove
11+ end
12+
13+ css('h3', 'h4', 'h5').each do |node|
14+ node.name = node.name.sub(/\d/) { |i| i.to_i - 1 }
15+ end
16+
17+ css('dd ul').each do |node|
18+ node.replace(node.css('li').map(&:inner_html).join(' '))
19+ end
20+
21+ css('pre').each do |node|
22+ node['data-language'] = 'javascript'
23+ node.content = node.content
24+ end
25+
26+ doc
27+ end
28+ end
29+ end
30+end
lib/docs/filters/async/entries.rb+22−0
@@ -0,0 +1,22 @@
1+module Docs
2+ class Async
3+ class EntriesFilter < Docs::EntriesFilter
4+ def additional_entries
5+ type = nil
6+ entries = []
7+
8+ css('.nav.methods li').each do |node|
9+ if node['class'] == 'toc-header'
10+ type = node.content
11+ else
12+ name = node.content
13+ id = node.at_css('a')['href'].remove('#')
14+ entries << [name, id, type]
15+ end
16+ end
17+
18+ entries
19+ end
20+ end
21+ end
22+end
lib/docs/scrapers/async.rb+21−0
@@ -0,0 +1,21 @@
1+module Docs
2+ class Async < UrlScraper
3+ self.type = 'async'
4+ self.release = '2.1.2'
5+ self.base_url = 'https://caolan.github.io/async/'
6+ self.root_path = 'docs.html'
7+ self.links = {
8+ home: 'https://caolan.github.io/async/',
9+ code: 'https://github.com/caolan/async'
10+ }
11+
12+ html_filters.push 'async/entries', 'async/clean_html'
13+
14+ options[:skip_links] = true
15+
16+ options[:attribution] = <<-HTML
17+ &copy; 2010&ndash;2016 Caolan McMahon<br>
18+ Licensed under the MIT License.
19+ HTML
20+ end
21+end
public/icons/docs/async/16.png+0−0

Binary file not shown.

public/icons/docs/async/16@2x.png+0−0

Binary file not shown.

public/icons/docs/async/SOURCE+1−0
@@ -0,0 +1 @@
1+https://raw.githubusercontent.com/caolan/async/master/logo/favicon.ico