Unified · Split
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class ReactNative |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − @doc = at_css('.inner-content, article.withtoc') | |
| 5 | + @doc = at_css('.post') | |
| 6 | 6 | |
| 7 | 7 | if root_page? |
| 8 | 8 | at_css('h1').content = 'React Native Documentation' |
| @@ -12,9 +12,9 @@ module Docs · 11 unmodified lines | ||
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | def get_type |
| 15 | − link = at_css('.nav-docs-section .active, .toc .active') | |
| 15 | + link = at_css('.navItemActive') | |
| 16 | 16 | return 'Miscellaneous' unless link |
| 17 | − section = link.ancestors('.nav-docs-section, section').first | |
| 17 | + section = link.ancestors('.navGroup').first | |
| 18 | 18 | type = section.at_css('h3').content.strip |
| 19 | 19 | type = REPLACE_TYPES[type] || type |
| 20 | 20 | type += ": #{name}" if type == 'Components' |
| @@ -22,15 +22,13 @@ module Docs · 1 unmodified line | ||
| 22 | 22 | end |
| 23 | 23 | |
| 24 | 24 | def additional_entries |
| 25 | − css('.props > .prop > .propTitle', '.props > .prop > .methodTitle').each_with_object [] do |node, entries| | |
| 26 | − name = node.children.find(&:text?).try(:content) | |
| 27 | − next if name.blank? | |
| 28 | − sep = node.content.include?('static') ? '.' : '#' | |
| 29 | − name.prepend(self.name + sep) | |
| 30 | − name << '()' if node['class'].include?('methodTitle') | |
| 31 | − name.remove! %r{\??\:\s*\z} | |
| 32 | − id = node.at_css('.anchor')['name'] | |
| 33 | − entries << [name, id] | |
| 25 | + css('.mainContainer h3').each_with_object [] do |node, entries| | |
| 26 | + subname = node.text | |
| 27 | + next if subname.blank? || node.css('code').empty? | |
| 28 | + sep = subname.include?('()') ? '.' : '#' | |
| 29 | + subname.prepend(name + sep) | |
| 30 | + id = node.at_css('.anchor')['id'] | |
| 31 | + entries << [subname, id] | |
| 34 | 32 | end |
| 35 | 33 | end |
| 36 | 34 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class ReactNative < UrlScraper |
| 3 | 3 | self.slug = 'react_native' |
| 4 | 4 | self.type = 'react_native' |
| 5 | − self.release = '0.49' | |
| 5 | + self.release = '0.55' | |
| 6 | 6 | self.base_url = 'https://facebook.github.io/react-native/docs/' |
| 7 | 7 | self.root_path = 'getting-started.html' |
| 8 | 8 | self.links = { |
| @@ -12,7 +12,7 @@ module Docs · 3 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | html_filters.push 'react_native/entries', 'react_native/clean_html' |
| 14 | 14 | |
| 15 | − options[:container] = '.documentationContent' | |
| 15 | + options[:container] = '.docMainWrapper' | |
| 16 | 16 | options[:skip_patterns] = [/\Asample\-/] |
| 17 | 17 | options[:skip] = %w( |
| 18 | 18 | videos.html |
| @@ -27,7 +27,7 @@ module Docs · 8 unmodified lines | ||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | options[:attribution] = <<-HTML |
| 30 | − © 2015–2017 Facebook Inc.<br> | |
| 30 | + © 2015–2018 Facebook Inc.<br> | |
| 31 | 31 | Licensed under the Creative Commons Attribution 4.0 International Public License. |
| 32 | 32 | HTML |
| 33 | 33 | end |