From aa0ba9a339e012896d8c100c3b442d712971f32c Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 10 Jul 2016 16:02:04 -0400 Subject: [PATCH] Update React Native documentation (0.29) --- lib/docs/filters/react/entries.rb | 5 +++-- lib/docs/filters/react_native/clean_html.rb | 6 +++++- lib/docs/scrapers/react_native.rb | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/docs/filters/react/entries.rb b/lib/docs/filters/react/entries.rb index 2bfff053..b52d46e6 100644 --- a/lib/docs/filters/react/entries.rb +++ b/lib/docs/filters/react/entries.rb @@ -9,6 +9,7 @@ module Docs REPLACE_TYPES = { 'Quick Start' => 'Guides', + 'The Basics' => 'Getting Started', 'apis' => 'APIs', 'components' => 'Components' } @@ -40,12 +41,12 @@ module Docs else entries = [] - css('.props > .prop > .propTitle').each do |node| # react-native + css('.props > .prop > .propTitle', '.props > .prop > .methodTitle').each do |node| # react-native name = node.children.find(&:text?).try(:content) next if name.blank? sep = node.content.include?('static') ? '.' : '#' name.prepend(self.name + sep) - name << '()' if (n = node.css('.propType').last) && n.content.start_with?('(') + name << '()' if node['class'].include?('methodTitle') id = node.at_css('.anchor')['name'] entries << [name, id] end diff --git a/lib/docs/filters/react_native/clean_html.rb b/lib/docs/filters/react_native/clean_html.rb index 6f74ca31..c34ca83c 100644 --- a/lib/docs/filters/react_native/clean_html.rb +++ b/lib/docs/filters/react_native/clean_html.rb @@ -6,7 +6,11 @@ module Docs css('#unsupported + div + center', '#unsupported + div', '#unsupported', '.toggler', 'center > img').remove end - css('center > .button', 'p:contains("short survey")').remove + css('center > .button', 'p:contains("short survey")', 'iframe', '.embedded-simulator').remove + + css('h4.methodTitle').each do |node| + node.name = 'h3' + end doc end diff --git a/lib/docs/scrapers/react_native.rb b/lib/docs/scrapers/react_native.rb index 8187878f..6baa9b9e 100644 --- a/lib/docs/scrapers/react_native.rb +++ b/lib/docs/scrapers/react_native.rb @@ -3,7 +3,7 @@ module Docs self.name = 'React Native' self.slug = 'react_native' self.type = 'react' - self.release = '0.28' + self.release = '0.29' self.base_url = 'https://facebook.github.io/react-native/docs/' self.root_path = 'getting-started.html' self.links = { @@ -19,7 +19,9 @@ module Docs options[:skip] = %w( videos.html transforms.html - troubleshooting.html) + troubleshooting.html + more-resources.html + ) options[:fix_urls] = ->(url) { url.sub! 'docs/docs', 'docs'