History

Update Relay documentation (0.10.0)

Thibaut Courouble committed 9 years ago

Commit f18e92d1 parent 3ecb2a72 files · +17 −2Browse files

Unified · Split

2 files
  1. lib/docs/filters/react/entries.rb +16 −1
  2. lib/docs/scrapers/relay.rb +1 −1
lib/docs/filters/react/entries.rb+16−1
@@ -14,7 +14,9 @@ module Docs · 13 unmodified lines
14 end14 end
15 15
16 def additional_entries16 def additional_entries
17 css('.inner-content h3 code, .inner-content h4 code').each_with_object([]) do |node, entries|17 entries = []
18
19 css('.inner-content h3 code, .inner-content h4 code').each do |node|
18 name = node.content20 name = node.content
19 name.remove! %r{[#\(\)]}21 name.remove! %r{[#\(\)]}
20 name.remove! %r{\w+\:}22 name.remove! %r{\w+\:}
@@ -30,6 +32,19 @@ module Docs · 9 unmodified lines
30 end32 end
31 entries << [name, id, type]33 entries << [name, id, type]
32 end34 end
35
36 css('.apiIndex a pre').each do |node| # relay
37 next unless node.parent['href'].start_with?('#')
38 id = node.parent['href'].remove('#')
39 name = node.content.strip
40 sep = name.start_with?('static') ? '.' : '#'
41 name.remove! %r{(abstract|static) }
42 name.sub! %r{\(.*\)}, '()'
43 name.prepend(self.name + sep)
44 entries << [name, id]
45 end
46
47 entries
33 end48 end
34 end49 end
35 end50 end
lib/docs/scrapers/relay.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Relay < React2 class Relay < React
3 self.type = 'react'3 self.type = 'react'
4 self.release = '0.9.3'4 self.release = '0.10.0'
5 self.base_url = 'https://facebook.github.io/relay/docs/'5 self.base_url = 'https://facebook.github.io/relay/docs/'
6 self.root_path = 'getting-started.html'6 self.root_path = 'getting-started.html'
7 self.links = {7 self.links = {