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 @@
1[1[
2 [2 [
3 "2016-11-20",3 "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>"
5 ], [5 ], [
6 "2016-10-10",6 "2016-10-10",
7 "New documentations: <a href=\"/scikit_learn/\">scikit-learn</a> and <a href=\"/statsmodels/\">Statsmodels</a>"7 "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
99 '2016 The Apache Software Foundation<br>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.',99 '2016 The Apache Software Foundation<br>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.',
100 'Apache',100 'Apache',
101 'https://www.apache.org/licenses/LICENSE-2.0'101 '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'
102 ], [107 ], [
103 'Backbone.js',108 'Backbone.js',
104 '2010-2016 Jeremy Ashkenas, DocumentCloud',109 '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
8 8
9app.views.AngularPage =9app.views.AngularPage =
10app.views.AngularjsPage =10app.views.AngularjsPage =
11app.views.AsyncPage =
11app.views.BootstrapPage =12app.views.BootstrapPage =
12app.views.BowerPage =13app.views.BowerPage =
13app.views.CPage =14app.views.CPage =
assets/stylesheets/application-dark.css.scss+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
34 'pages/angular',34 'pages/angular',
35 'pages/angularjs',35 'pages/angularjs',
36 'pages/apache',36 'pages/apache',
37 'pages/async',
37 'pages/bootstrap',38 'pages/bootstrap',
38 'pages/c',39 'pages/c',
39 'pages/cakephp',40 'pages/cakephp',
assets/stylesheets/application.css.scss+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
34 'pages/angular',34 'pages/angular',
35 'pages/angularjs',35 'pages/angularjs',
36 'pages/apache',36 'pages/apache',
37 'pages/async',
37 'pages/bootstrap',38 'pages/bootstrap',
38 'pages/c',39 'pages/c',
39 'pages/cakephp',40 'pages/cakephp',
assets/stylesheets/global/_icons.scss+1−0
@@ -56,6 +56,7 @@ · 55 unmodified lines
56%icon-close-white { background-position: -2rem -5rem; }56%icon-close-white { background-position: -2rem -5rem; }
57%icon-back { background-position: -3rem -5rem; @extend %darkIconFix !optional; }57%icon-back { background-position: -3rem -5rem; @extend %darkIconFix !optional; }
58 58
59._icon-async:before { background-position: -6rem 0; @extend %darkIconFix !optional; }
59._icon-http:before { background-position: -7rem 0; @extend %darkIconFix !optional; }60._icon-http:before { background-position: -7rem 0; @extend %darkIconFix !optional; }
60._icon-jquery:before { background-position: -8rem 0; @extend %darkIconFix !optional; }61._icon-jquery:before { background-position: -8rem 0; @extend %darkIconFix !optional; }
61._icon-underscore:before { background-position: -9rem 0; @extend %darkIconFix !optional; }62._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 @@
1module 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
30end
lib/docs/filters/async/entries.rb+22−0
@@ -0,0 +1,22 @@
1module 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
22end
lib/docs/scrapers/async.rb+21−0
@@ -0,0 +1,21 @@
1module 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
21end
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 @@
1https://raw.githubusercontent.com/caolan/async/master/logo/favicon.ico