Add Relay documentation

pull/304/head
Thibaut 9 years ago
parent 2bf94f5491
commit 44bb507254

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 94 KiB

@ -1,7 +1,7 @@
[
[
"2015-11-22",
"New documentations: <a href=\"/dojo/\">Dojo</a> and <a href=\"/flow/\">Flow</a>"
"New documentations: <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</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, Flow',
'React, React Native, Flow, Relay',
'2013-2015 Facebook Inc.',
'CC BY',
'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'

@ -120,3 +120,4 @@
._icon-vagrant:before { background-position: -5rem -9rem; }
._icon-dojo:before { background-position: -6rem -9rem; }
._icon-flow:before { background-position: -7rem -9rem; }
._icon-relay:before { background-position: -8rem -9rem; }

@ -3,7 +3,7 @@
> h3 { @extend %block-label, %label-blue; }
> h4 { @extend %block-label; }
p code { @extend %label; }
p code, li code { @extend %label; }
blockquote { @extend %note; }
span.platform { float: right; }

@ -41,6 +41,14 @@ module Docs
node.before(node.children).remove
end
css('a pre').each do |node|
node.name = 'code'
end
css('a[target]').each do |node|
node.remove_attribute('target')
end
doc
end
end

@ -37,7 +37,9 @@ module Docs
[name, id, type]
end
else
css('.props > .prop > .propTitle').each_with_object([]) do |node, entries|
entries = []
css('.props > .prop > .propTitle').each do |node| # react-native
name = node.children.find(&:text?).try(:content)
next if name.blank?
sep = node.content.include?('static') ? '.' : '#'
@ -46,6 +48,19 @@ module Docs
id = node.at_css('.anchor')['name']
entries << [name, id]
end
css('.apiIndex a pre').each do |node| # relay
next unless node.parent['href'].start_with?('#')
id = node.parent['href'].remove('#')
name = node.content.strip
sep = name.start_with?('static') ? '.' : '#'
name.remove! %r{(abstract|static) }
name.sub! %r{\(.*\)}, '()'
name.prepend(self.name + sep)
entries << [name, id]
end
entries
end
end
end

@ -0,0 +1,21 @@
module Docs
class Relay < React
self.type = 'react'
self.version = '0.5'
self.base_url = 'https://facebook.github.io/relay/docs/'
self.root_path = 'getting-started.html'
self.links = {
home: 'https://facebook.github.io/relay/',
code: 'https://github.com/facebook/relay'
}
options[:root_title] = 'Relay Documentation'
options[:only_patterns] = nil
options[:skip] = %w(videos.html graphql-further-reading.html)
options[:attribution] = <<-HTML
&copy; 2013&ndash;2015 Facebook Inc.<br>
Licensed under the BSD License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Loading…
Cancel
Save