History

update React Native to 0.55

Beau Carnes committed 8 years ago

Commit b97b6031 parent a5b6ffb3 files · +13 −15Browse files

Unified · Split

3 files
  1. lib/docs/filters/react_native/clean_html.rb +1 −1
  2. lib/docs/filters/react_native/entries.rb +9 −11
  3. lib/docs/scrapers/react_native.rb +3 −3
lib/docs/filters/react_native/clean_html.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class ReactNative
33 class CleanHtmlFilter < Filter
44 def call
5− @doc = at_css('.inner-content, article.withtoc')
5+ @doc = at_css('.post')
66
77 if root_page?
88 at_css('h1').content = 'React Native Documentation'
lib/docs/filters/react_native/entries.rb+9−11
@@ -12,9 +12,9 @@ module Docs · 11 unmodified lines
1212 end
1313
1414 def get_type
15− link = at_css('.nav-docs-section .active, .toc .active')
15+ link = at_css('.navItemActive')
1616 return 'Miscellaneous' unless link
17− section = link.ancestors('.nav-docs-section, section').first
17+ section = link.ancestors('.navGroup').first
1818 type = section.at_css('h3').content.strip
1919 type = REPLACE_TYPES[type] || type
2020 type += ": #{name}" if type == 'Components'
@@ -22,15 +22,13 @@ module Docs · 1 unmodified line
2222 end
2323
2424 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]
3432 end
3533 end
3634 end
lib/docs/scrapers/react_native.rb+3−3
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class ReactNative < UrlScraper
33 self.slug = 'react_native'
44 self.type = 'react_native'
5− self.release = '0.49'
5+ self.release = '0.55'
66 self.base_url = 'https://facebook.github.io/react-native/docs/'
77 self.root_path = 'getting-started.html'
88 self.links = {
@@ -12,7 +12,7 @@ module Docs · 3 unmodified lines
1212
1313 html_filters.push 'react_native/entries', 'react_native/clean_html'
1414
15− options[:container] = '.documentationContent'
15+ options[:container] = '.docMainWrapper'
1616 options[:skip_patterns] = [/\Asample\-/]
1717 options[:skip] = %w(
1818 videos.html
@@ -27,7 +27,7 @@ module Docs · 8 unmodified lines
2727 }
2828
2929 options[:attribution] = <<-HTML
30− &copy; 2015&ndash;2017 Facebook Inc.<br>
30+ &copy; 2015&ndash;2018 Facebook Inc.<br>
3131 Licensed under the Creative Commons Attribution 4.0 International Public License.
3232 HTML
3333 end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t