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 @@
1[1[
2 [2 [
3 "2015-11-22",3 "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>"
5 ], [5 ], [
6 "2015-11-08",6 "2015-11-08",
7 "New documentations: <a href=\"/elixir/\">Elixir</a> and <a href=\"/vagrant/\">Vagrant</a>"7 "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
325 'MIT',325 'MIT',
326 'https://raw.githubusercontent.com/kriskowal/q/v1/LICENSE'326 'https://raw.githubusercontent.com/kriskowal/q/v1/LICENSE'
327 ], [327 ], [
328 'React, React Native, Flow',328 'React, React Native, Flow, Relay',
329 '2013-2015 Facebook Inc.',329 '2013-2015 Facebook Inc.',
330 'CC BY',330 'CC BY',
331 'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'331 'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'
assets/stylesheets/global/_icons.scss+1−0
@@ -120,3 +120,4 @@ · 119 unmodified lines
120._icon-vagrant:before { background-position: -5rem -9rem; }120._icon-vagrant:before { background-position: -5rem -9rem; }
121._icon-dojo:before { background-position: -6rem -9rem; }121._icon-dojo:before { background-position: -6rem -9rem; }
122._icon-flow:before { background-position: -7rem -9rem; }122._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
3 > h3 { @extend %block-label, %label-blue; }3 > h3 { @extend %block-label, %label-blue; }
4 > h4 { @extend %block-label; }4 > h4 { @extend %block-label; }
5 5
6 p code { @extend %label; }6 p code, li code { @extend %label; }
7 blockquote { @extend %note; }7 blockquote { @extend %note; }
8 8
9 span.platform { float: right; }9 span.platform { float: right; }
lib/docs/filters/react/clean_html.rb+8−0
@@ -41,6 +41,14 @@ module Docs · 40 unmodified lines
41 node.before(node.children).remove41 node.before(node.children).remove
42 end42 end
43 43
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
44 doc52 doc
45 end53 end
46 end54 end
lib/docs/filters/react/entries.rb+16−1
@@ -37,7 +37,9 @@ module Docs · 36 unmodified lines
37 [name, id, type]37 [name, id, type]
38 end38 end
39 else39 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
41 name = node.children.find(&:text?).try(:content)43 name = node.children.find(&:text?).try(:content)
42 next if name.blank?44 next if name.blank?
43 sep = node.content.include?('static') ? '.' : '#'45 sep = node.content.include?('static') ? '.' : '#'
@@ -46,6 +48,19 @@ module Docs · 2 unmodified lines
46 id = node.at_css('.anchor')['name']48 id = node.at_css('.anchor')['name']
47 entries << [name, id]49 entries << [name, id]
48 end50 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
49 end64 end
50 end65 end
51 end66 end
lib/docs/scrapers/relay.rb+21−0
@@ -0,0 +1,21 @@
1module 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
21end
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.