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