History

Add Flow documentation

Thibaut committed 10 years ago

Commit 2bf94f51 parent 693986511 files · +30 −3Browse files

Unified · Split

11 files
  1. assets/images/icons.png +0 −0
  2. assets/images/icons@2x.png +0 −0
  3. assets/javascripts/news.json +1 −1
  4. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  5. assets/stylesheets/global/_icons.scss +1 −0
  6. assets/stylesheets/pages/_react.scss +1 −1
  7. lib/docs/filters/react/clean_html.rb +6 −2
  8. lib/docs/filters/react/entries.rb +2 −2
  9. lib/docs/scrapers/flow.rb +22 −0
  10. public/icons/docs/flow/16.png +0 −0
  11. public/icons/docs/flow/16@2x.png +0 −0
assets/images/icons.png+0−0

Binary file not shown.

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

Binary file not shown.

assets/javascripts/news.json+1−1
@@ -1,7 +1,7 @@
11 [
22 [
33 "2015-11-22",
4− "New documentation: <a href=\"/dojo/\">Dojo</a>"
4+ "New documentations: <a href=\"/dojo/\">Dojo</a> and <a href=\"/flow/\">Flow</a>"
55 ], [
66 "2015-11-08",
77 "New documentations: <a href=\"/elixir/\">Elixir</a> and <a href=\"/vagrant/\">Vagrant</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -325,7 +325,7 @@ credits = [ · 324 unmodified lines
325325 'MIT',
326326 'https://raw.githubusercontent.com/kriskowal/q/v1/LICENSE'
327327 ], [
328− 'React, React Native',
328+ 'React, React Native, Flow',
329329 '2013-2015 Facebook Inc.',
330330 'CC BY',
331331 'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'
assets/stylesheets/global/_icons.scss+1−0
@@ -119,3 +119,4 @@ · 118 unmodified lines
119119 ._icon-elixir:before { background-position: -4rem -9rem; @extend %darkIconFix !optional; }
120120 ._icon-vagrant:before { background-position: -5rem -9rem; }
121121 ._icon-dojo:before { background-position: -6rem -9rem; }
122+._icon-flow:before { background-position: -7rem -9rem; }
assets/stylesheets/pages/_react.scss+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 > h3 { @extend %block-label, %label-blue; }
44 > h4 { @extend %block-label; }
55
6− code { @extend %label; }
6+ p code { @extend %label; }
77 blockquote { @extend %note; }
88
99 span.platform { float: right; }
lib/docs/filters/react/clean_html.rb+6−2
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class React
33 class CleanHtmlFilter < Filter
44 def call
5− @doc = at_css('.inner-content')
5+ @doc = at_css('.inner-content, article.withtoc')
66
77 if root_page?
88 at_css('h1').content = context[:root_title]
@@ -16,10 +16,14 @@ module Docs · 7 unmodified lines
1616
1717 css('.highlight').each do |node|
1818 node.name = 'pre'
19− node['data-lang'] = node.at_css('[data-lang]')['data-lang']
19+ node['data-lang'] = node.at_css('[data-lang]').try(:[], 'data-lang') || 'js'
2020 node.content = node.content
2121 end
2222
23+ css('table.highlighttable').each do |node|
24+ node.replace(node.at_css('pre.highlight'))
25+ end
26+
2327 css('.prism').each do |node|
2428 node.name = 'pre'
2529 node['data-lang'] = node['class'][/(?<=language\-)(\w+)/]
lib/docs/filters/react/entries.rb+2−2
@@ -18,8 +18,8 @@ module Docs · 17 unmodified lines
1818 end
1919
2020 def get_type
21− link = at_css('.nav-docs-section .active')
22− section = link.ancestors('.nav-docs-section').first
21+ link = at_css('.nav-docs-section .active, .toc .active')
22+ section = link.ancestors('.nav-docs-section, section').first
2323 type = section.at_css('h3').content.strip
2424 type = REPLACE_TYPES[type] || type
2525 type += ": #{name}" if type == 'Components'
lib/docs/scrapers/flow.rb+22−0
@@ -0,0 +1,22 @@
1+module Docs
2+ class Flow < React
3+ self.type = 'react'
4+ self.version = '0.18'
5+ self.base_url = 'http://flowtype.org/docs/'
6+ self.root_path = 'about-flow.html'
7+ self.links = {
8+ home: 'http://flowtype.org/',
9+ code: 'https://github.com/facebook/flow'
10+ }
11+
12+ options[:container] = '.content'
13+ options[:root_title] = 'Flow Documentation'
14+ options[:only_patterns] = nil
15+ options[:skip] = %w(coming-soon.html)
16+
17+ options[:attribution] = <<-HTML
18+ &copy; 2013&ndash;2015 Facebook Inc.<br>
19+ Licensed under the BSD License.
20+ HTML
21+ end
22+end
public/icons/docs/flow/16.png+0−0

Binary file not shown.

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

Binary file not shown.