update React Native to 0.55

pull/813/merge
Beau Carnes 7 years ago committed by Thibaut Courouble
parent a5b6ffb116
commit b97b603795

@ -2,7 +2,7 @@ module Docs
class ReactNative class ReactNative
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('.inner-content, article.withtoc') @doc = at_css('.post')
if root_page? if root_page?
at_css('h1').content = 'React Native Documentation' at_css('h1').content = 'React Native Documentation'

@ -12,9 +12,9 @@ module Docs
end end
def get_type def get_type
link = at_css('.nav-docs-section .active, .toc .active') link = at_css('.navItemActive')
return 'Miscellaneous' unless link return 'Miscellaneous' unless link
section = link.ancestors('.nav-docs-section, section').first section = link.ancestors('.navGroup').first
type = section.at_css('h3').content.strip type = section.at_css('h3').content.strip
type = REPLACE_TYPES[type] || type type = REPLACE_TYPES[type] || type
type += ": #{name}" if type == 'Components' type += ": #{name}" if type == 'Components'
@ -22,15 +22,13 @@ module Docs
end end
def additional_entries def additional_entries
css('.props > .prop > .propTitle', '.props > .prop > .methodTitle').each_with_object [] do |node, entries| css('.mainContainer h3').each_with_object [] do |node, entries|
name = node.children.find(&:text?).try(:content) subname = node.text
next if name.blank? next if subname.blank? || node.css('code').empty?
sep = node.content.include?('static') ? '.' : '#' sep = subname.include?('()') ? '.' : '#'
name.prepend(self.name + sep) subname.prepend(name + sep)
name << '()' if node['class'].include?('methodTitle') id = node.at_css('.anchor')['id']
name.remove! %r{\??\:\s*\z} entries << [subname, id]
id = node.at_css('.anchor')['name']
entries << [name, id]
end end
end end
end end

@ -2,7 +2,7 @@ module Docs
class ReactNative < UrlScraper class ReactNative < UrlScraper
self.slug = 'react_native' self.slug = 'react_native'
self.type = 'react_native' self.type = 'react_native'
self.release = '0.49' self.release = '0.55'
self.base_url = 'https://facebook.github.io/react-native/docs/' self.base_url = 'https://facebook.github.io/react-native/docs/'
self.root_path = 'getting-started.html' self.root_path = 'getting-started.html'
self.links = { self.links = {
@ -12,7 +12,7 @@ module Docs
html_filters.push 'react_native/entries', 'react_native/clean_html' html_filters.push 'react_native/entries', 'react_native/clean_html'
options[:container] = '.documentationContent' options[:container] = '.docMainWrapper'
options[:skip_patterns] = [/\Asample\-/] options[:skip_patterns] = [/\Asample\-/]
options[:skip] = %w( options[:skip] = %w(
videos.html videos.html
@ -27,7 +27,7 @@ module Docs
} }
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2015&ndash;2017 Facebook Inc.<br> &copy; 2015&ndash;2018 Facebook Inc.<br>
Licensed under the Creative Commons Attribution 4.0 International Public License. Licensed under the Creative Commons Attribution 4.0 International Public License.
HTML HTML
end end

Loading…
Cancel
Save