History

Add Redux documentation

Thibaut Courouble committed 10 years ago

Commit 7ab53671 parent 8e35fa313 files · +98 −-3Browse files

Unified · Split

13 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/global/_icons.scss +1 −0
  7. assets/stylesheets/pages/_simple.scss +2 −0
  8. lib/docs/filters/redux/clean_html.rb +38 −0
  9. lib/docs/filters/redux/entries.rb +29 −0
  10. lib/docs/scrapers/redux.rb +24 −0
  11. public/icons/docs/redux/16.png +0 −0
  12. public/icons/docs/redux/16@2x.png +0 −0
  13. public/icons/docs/redux/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-07-24",3 "2016-07-24",
4 "New documentations: <a href=\"/julia/\">Julia</a> and <a href=\"/crystal/\">Crystal</a>"4 "New documentations: <a href=\"/julia/\">Julia</a>, <a href=\"/crystal/\">Crystal</a> and <a href=\"/redux/\">Redux</a>"
5 ], [5 ], [
6 "2016-07-03",6 "2016-07-03",
7 "New documentations: <a href=\"/cmake/\">CMake</a> and <a href=\"/matplotlib/\">Matplotlib</a>"7 "New documentations: <a href=\"/cmake/\">CMake</a> and <a href=\"/matplotlib/\">Matplotlib</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -435,6 +435,11 @@ credits = [ · 434 unmodified lines
435 '2009-2016 Salvatore Sanfilippo',435 '2009-2016 Salvatore Sanfilippo',
436 'CC BY-SA',436 'CC BY-SA',
437 'https://creativecommons.org/licenses/by-sa/4.0/'437 'https://creativecommons.org/licenses/by-sa/4.0/'
438 ], [
439 'Redux',
440 '2015-2016 Dan Abramov',
441 'MIT',
442 'https://raw.githubusercontent.com/reactjs/redux/master/LICENSE.md'
438 ], [443 ], [
439 'RequireJS',444 'RequireJS',
440 'jQuery Foundation and other contributors',445 'jQuery Foundation and other contributors',
assets/javascripts/views/pages/simple.coffee+1−0
@@ -37,6 +37,7 @@ app.views.PhpunitPage = · 36 unmodified lines
37app.views.PostgresPage =37app.views.PostgresPage =
38app.views.RamdaPage =38app.views.RamdaPage =
39app.views.ReactPage =39app.views.ReactPage =
40app.views.ReduxPage =
40app.views.RethinkdbPage =41app.views.RethinkdbPage =
41app.views.RubydocPage =42app.views.RubydocPage =
42app.views.SinonPage =43app.views.SinonPage =
assets/stylesheets/global/_icons.scss+1−0
@@ -132,6 +132,7 @@ · 131 unmodified lines
132._icon-q:before { background-position: -5rem -8rem; }132._icon-q:before { background-position: -5rem -8rem; }
133._icon-crystal:before { background-position: -6rem -8rem; @extend %darkIconFix !optional; }133._icon-crystal:before { background-position: -6rem -8rem; @extend %darkIconFix !optional; }
134._icon-julia:before { background-position: -7rem -8rem; @extend %darkIconFix !optional; }134._icon-julia:before { background-position: -7rem -8rem; @extend %darkIconFix !optional; }
135._icon-redux:before { background-position: -8rem -8rem; @extend %darkIconFix !optional; }
135._icon-react_native:before { background-position: 0 -9rem; }136._icon-react_native:before { background-position: 0 -9rem; }
136._icon-phalcon:before { background-position: -1rem -9rem; }137._icon-phalcon:before { background-position: -1rem -9rem; }
137._icon-matplotlib:before { background-position: -2rem -9rem; }138._icon-matplotlib:before { background-position: -2rem -9rem; }
assets/stylesheets/pages/_simple.scss+2−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
14 14
15 p > code, li > code { @extend %label; }15 p > code, li > code { @extend %label; }
16 blockquote { @extend %note; }16 blockquote { @extend %note; }
17 blockquote > h4, blockquote > h5 { margin-top: .25rem; }
17}18}
18 19
19._apache_pig,20._apache_pig,
@@ -29,6 +30,7 @@ · 9 unmodified lines
29._markdown,30._markdown,
30._mocha,31._mocha,
31._mongoose,32._mongoose,
33._redux,
32._sinon,34._sinon,
33._typescript,35._typescript,
34._webpack {36._webpack {
lib/docs/filters/redux/clean_html.rb+38−0
@@ -0,0 +1,38 @@
1module Docs
2 class Redux
3 class CleanHtmlFilter < Filter
4 def call
5 @doc = at_css('.page-inner > section')
6
7 css('#edit-link', 'hr').remove
8
9 at_css('h2').name = 'h1' unless at_css('h1')
10
11 if root_page?
12 at_css('h1').content = 'Redux'
13
14 at_css('a[href="https://www.npmjs.com/package/redux"]').parent.remove
15
16 css('a[target]').each do |node|
17 node.remove_attribute('target') unless node['href'].start_with?('http')
18 end
19 end
20
21 css('a[id]:empty').each do |node|
22 (node.next_element || node.parent.next_element)['id'] = node['id']
23 end
24
25 css('h1 > code').each do |node|
26 node.before(node.children).remove
27 end
28
29 css('pre > code').each do |node|
30 node.parent['data-language'] = node['class'][/lang-(\w+)/, 1] if node['class']
31 node.parent.content = node.parent.content
32 end
33
34 doc
35 end
36 end
37 end
38end
lib/docs/filters/redux/entries.rb+29−0
@@ -0,0 +1,29 @@
1module Docs
2 class Redux
3 class EntriesFilter < Docs::EntriesFilter
4 def get_name
5 name = at_css('.page-inner h1, .page-inner h2').content
6 name.sub! %r{\(.*\)}, '()'
7 name
8 end
9
10 def get_type
11 path = slug.split('/')
12
13 if path.length > 1
14 path[0].titleize.sub('Api', 'API')
15 else
16 'Miscellaneous'
17 end
18 end
19
20 def additional_entries
21 css('#store-methods + ul > li > a').map do |node|
22 id = node['href'].remove('#')
23 name = "#{self.name}##{id}()"
24 [name, id]
25 end
26 end
27 end
28 end
29end
lib/docs/scrapers/redux.rb+24−0
@@ -0,0 +1,24 @@
1module Docs
2 class Redux < UrlScraper
3 self.type = 'redux'
4 self.release = '3.5.2'
5 self.base_url = 'http://redux.js.org/docs/'
6 self.links = {
7 home: 'http://redux.js.org/',
8 code: 'https://github.com/reactjs/redux/'
9 }
10
11 html_filters.push 'redux/entries', 'redux/clean_html'
12
13 options[:skip] = %w(Feedback.html)
14
15 options[:attribution] = <<-HTML
16 &copy; 2015&ndash;2016 Dan Abramov<br>
17 Licensed under the MIT License.
18 HTML
19
20 stub '' do
21 request_one('http://redux.js.org/index.html').body
22 end
23 end
24end
public/icons/docs/redux/16.png+0−0

Binary file not shown.

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

Binary file not shown.

public/icons/docs/redux/SOURCE+1−0
@@ -0,0 +1 @@
1http://redux.js.org/gitbook/images/favicon.ico