From f18e92df47d56c8836468ff45e6df9e23e2a8f2f Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Mon, 2 Jan 2017 15:58:00 -0500 Subject: [PATCH] Update Relay documentation (0.10.0) --- lib/docs/filters/react/entries.rb | 17 ++++++++++++++++- lib/docs/scrapers/relay.rb | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/react/entries.rb b/lib/docs/filters/react/entries.rb index 2a22dc22..001edbc2 100644 --- a/lib/docs/filters/react/entries.rb +++ b/lib/docs/filters/react/entries.rb @@ -14,7 +14,9 @@ module Docs end def additional_entries - css('.inner-content h3 code, .inner-content h4 code').each_with_object([]) do |node, entries| + entries = [] + + css('.inner-content h3 code, .inner-content h4 code').each do |node| name = node.content name.remove! %r{[#\(\)]} name.remove! %r{\w+\:} @@ -30,6 +32,19 @@ module Docs end entries << [name, id, type] 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 diff --git a/lib/docs/scrapers/relay.rb b/lib/docs/scrapers/relay.rb index f7ee20c4..7d3db132 100644 --- a/lib/docs/scrapers/relay.rb +++ b/lib/docs/scrapers/relay.rb @@ -1,7 +1,7 @@ module Docs class Relay < React self.type = 'react' - self.release = '0.9.3' + self.release = '0.10.0' self.base_url = 'https://facebook.github.io/relay/docs/' self.root_path = 'getting-started.html' self.links = {