History

Add Relay documentation

Thibaut committed 10 years ago

Commit 44bb5071 parent 2bf94f511 files · +45 −0Browse 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 +8 −0
  8. lib/docs/filters/react/entries.rb +16 −1
  9. lib/docs/scrapers/relay.rb +21 −0
  10. public/icons/docs/relay/16.png +0 −0
  11. public/icons/docs/relay/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 documentations: <a href=\"/dojo/\">Dojo</a> and <a href=\"/flow/\">Flow</a>"
4+ "New documentations: <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</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, Flow',
328+ 'React, React Native, Flow, Relay',
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
@@ -120,3 +120,4 @@ · 119 unmodified lines
120120 ._icon-vagrant:before { background-position: -5rem -9rem; }
121121 ._icon-dojo:before { background-position: -6rem -9rem; }
122122 ._icon-flow:before { background-position: -7rem -9rem; }
123+._icon-relay:before { background-position: -8rem -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− p code { @extend %label; }
6+ p code, li code { @extend %label; }
77 blockquote { @extend %note; }
88
99 span.platform { float: right; }
lib/docs/filters/react/clean_html.rb+8−0
@@ -41,6 +41,14 @@ module Docs · 40 unmodified lines
4141 node.before(node.children).remove
4242 end
4343
44+ css('a pre').each do |node|
45+ node.name = 'code'
46+ end
47+
48+ css('a[target]').each do |node|
49+ node.remove_attribute('target')
50+ end
51+
4452 doc
4553 end
4654 end
lib/docs/filters/react/entries.rb+16−1
@@ -37,7 +37,9 @@ module Docs · 36 unmodified lines
3737 [name, id, type]
3838 end
3939 else
40− css('.props > .prop > .propTitle').each_with_object([]) do |node, entries|
40+ entries = []
41+
42+ css('.props > .prop > .propTitle').each do |node| # react-native
4143 name = node.children.find(&:text?).try(:content)
4244 next if name.blank?
4345 sep = node.content.include?('static') ? '.' : '#'
@@ -46,6 +48,19 @@ module Docs · 2 unmodified lines
4648 id = node.at_css('.anchor')['name']
4749 entries << [name, id]
4850 end
51+
52+ css('.apiIndex a pre').each do |node| # relay
53+ next unless node.parent['href'].start_with?('#')
54+ id = node.parent['href'].remove('#')
55+ name = node.content.strip
56+ sep = name.start_with?('static') ? '.' : '#'
57+ name.remove! %r{(abstract|static) }
58+ name.sub! %r{\(.*\)}, '()'
59+ name.prepend(self.name + sep)
60+ entries << [name, id]
61+ end
62+
63+ entries
4964 end
5065 end
5166 end
lib/docs/scrapers/relay.rb+21−0
@@ -0,0 +1,21 @@
1+module Docs
2+ class Relay < React
3+ self.type = 'react'
4+ self.version = '0.5'
5+ self.base_url = 'https://facebook.github.io/relay/docs/'
6+ self.root_path = 'getting-started.html'
7+ self.links = {
8+ home: 'https://facebook.github.io/relay/',
9+ code: 'https://github.com/facebook/relay'
10+ }
11+
12+ options[:root_title] = 'Relay Documentation'
13+ options[:only_patterns] = nil
14+ options[:skip] = %w(videos.html graphql-further-reading.html)
15+
16+ options[:attribution] = <<-HTML
17+ &copy; 2013&ndash;2015 Facebook Inc.<br>
18+ Licensed under the BSD License.
19+ HTML
20+ end
21+end
public/icons/docs/relay/16.png+0−0

Binary file not shown.

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

Binary file not shown.