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
1414 end
1515
1616 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|
1820 name = node.content
1921 name.remove! %r{[#\(\)]}
2022 name.remove! %r{\w+\:}
@@ -30,6 +32,19 @@ module Docs · 9 unmodified lines
3032 end
3133 entries << [name, id, type]
3234 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
3348 end
3449 end
3550 end
lib/docs/scrapers/relay.rb+1−1
@@ -1,7 +1,7 @@
11 module Docs
22 class Relay < React
33 self.type = 'react'
4− self.release = '0.9.3'
4+ self.release = '0.10.0'
55 self.base_url = 'https://facebook.github.io/relay/docs/'
66 self.root_path = 'getting-started.html'
77 self.links = {