mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Add Flow documentation
This commit is contained in:
parent
6939865137
commit
2bf94f5491
11 changed files with 34 additions and 7 deletions
Binary file not shown.
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Binary file not shown.
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 93 KiB |
|
@ -1,7 +1,7 @@
|
|||
[
|
||||
[
|
||||
"2015-11-22",
|
||||
"New documentation: <a href=\"/dojo/\">Dojo</a>"
|
||||
"New documentations: <a href=\"/dojo/\">Dojo</a> and <a href=\"/flow/\">Flow</a>"
|
||||
], [
|
||||
"2015-11-08",
|
||||
"New documentations: <a href=\"/elixir/\">Elixir</a> and <a href=\"/vagrant/\">Vagrant</a>"
|
||||
|
|
|
@ -325,7 +325,7 @@ credits = [
|
|||
'MIT',
|
||||
'https://raw.githubusercontent.com/kriskowal/q/v1/LICENSE'
|
||||
], [
|
||||
'React, React Native',
|
||||
'React, React Native, Flow',
|
||||
'2013-2015 Facebook Inc.',
|
||||
'CC BY',
|
||||
'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'
|
||||
|
|
|
@ -119,3 +119,4 @@
|
|||
._icon-elixir:before { background-position: -4rem -9rem; @extend %darkIconFix !optional; }
|
||||
._icon-vagrant:before { background-position: -5rem -9rem; }
|
||||
._icon-dojo:before { background-position: -6rem -9rem; }
|
||||
._icon-flow:before { background-position: -7rem -9rem; }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
> h3 { @extend %block-label, %label-blue; }
|
||||
> h4 { @extend %block-label; }
|
||||
|
||||
code { @extend %label; }
|
||||
p code { @extend %label; }
|
||||
blockquote { @extend %note; }
|
||||
|
||||
span.platform { float: right; }
|
||||
|
|
|
@ -2,7 +2,7 @@ module Docs
|
|||
class React
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.inner-content')
|
||||
@doc = at_css('.inner-content, article.withtoc')
|
||||
|
||||
if root_page?
|
||||
at_css('h1').content = context[:root_title]
|
||||
|
@ -16,10 +16,14 @@ module Docs
|
|||
|
||||
css('.highlight').each do |node|
|
||||
node.name = 'pre'
|
||||
node['data-lang'] = node.at_css('[data-lang]')['data-lang']
|
||||
node['data-lang'] = node.at_css('[data-lang]').try(:[], 'data-lang') || 'js'
|
||||
node.content = node.content
|
||||
end
|
||||
|
||||
css('table.highlighttable').each do |node|
|
||||
node.replace(node.at_css('pre.highlight'))
|
||||
end
|
||||
|
||||
css('.prism').each do |node|
|
||||
node.name = 'pre'
|
||||
node['data-lang'] = node['class'][/(?<=language\-)(\w+)/]
|
||||
|
|
|
@ -18,8 +18,8 @@ module Docs
|
|||
end
|
||||
|
||||
def get_type
|
||||
link = at_css('.nav-docs-section .active')
|
||||
section = link.ancestors('.nav-docs-section').first
|
||||
link = at_css('.nav-docs-section .active, .toc .active')
|
||||
section = link.ancestors('.nav-docs-section, section').first
|
||||
type = section.at_css('h3').content.strip
|
||||
type = REPLACE_TYPES[type] || type
|
||||
type += ": #{name}" if type == 'Components'
|
||||
|
|
22
lib/docs/scrapers/flow.rb
Normal file
22
lib/docs/scrapers/flow.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
module Docs
|
||||
class Flow < React
|
||||
self.type = 'react'
|
||||
self.version = '0.18'
|
||||
self.base_url = 'http://flowtype.org/docs/'
|
||||
self.root_path = 'about-flow.html'
|
||||
self.links = {
|
||||
home: 'http://flowtype.org/',
|
||||
code: 'https://github.com/facebook/flow'
|
||||
}
|
||||
|
||||
options[:container] = '.content'
|
||||
options[:root_title] = 'Flow Documentation'
|
||||
options[:only_patterns] = nil
|
||||
options[:skip] = %w(coming-soon.html)
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2013–2015 Facebook Inc.<br>
|
||||
Licensed under the BSD License.
|
||||
HTML
|
||||
end
|
||||
end
|
BIN
public/icons/docs/flow/16.png
Normal file
BIN
public/icons/docs/flow/16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 511 B |
BIN
public/icons/docs/flow/16@2x.png
Normal file
BIN
public/icons/docs/flow/16@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 974 B |
Loading…
Reference in a new issue