Browse Source

Update React Native documentation (0.29)

Thibaut Courouble 9 years ago
parent
commit
aa0ba9a339

+ 3 - 2
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

+ 5 - 1
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

+ 4 - 2
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'