Update React Native documentation (0.29)

This commit is contained in:
Thibaut Courouble 2016-07-10 16:02:04 -04:00
parent e4487c9a06
commit aa0ba9a339
3 changed files with 12 additions and 5 deletions

View file

@ -9,6 +9,7 @@ module Docs
REPLACE_TYPES = { REPLACE_TYPES = {
'Quick Start' => 'Guides', 'Quick Start' => 'Guides',
'The Basics' => 'Getting Started',
'apis' => 'APIs', 'apis' => 'APIs',
'components' => 'Components' 'components' => 'Components'
} }
@ -40,12 +41,12 @@ module Docs
else else
entries = [] 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) name = node.children.find(&:text?).try(:content)
next if name.blank? next if name.blank?
sep = node.content.include?('static') ? '.' : '#' sep = node.content.include?('static') ? '.' : '#'
name.prepend(self.name + sep) 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'] id = node.at_css('.anchor')['name']
entries << [name, id] entries << [name, id]
end end

View file

@ -6,7 +6,11 @@ module Docs
css('#unsupported + div + center', '#unsupported + div', '#unsupported', '.toggler', 'center > img').remove css('#unsupported + div + center', '#unsupported + div', '#unsupported', '.toggler', 'center > img').remove
end 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 doc
end end

View file

@ -3,7 +3,7 @@ module Docs
self.name = 'React Native' self.name = 'React Native'
self.slug = 'react_native' self.slug = 'react_native'
self.type = 'react' self.type = 'react'
self.release = '0.28' self.release = '0.29'
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 = {
@ -19,7 +19,9 @@ module Docs
options[:skip] = %w( options[:skip] = %w(
videos.html videos.html
transforms.html transforms.html
troubleshooting.html) troubleshooting.html
more-resources.html
)
options[:fix_urls] = ->(url) { options[:fix_urls] = ->(url) {
url.sub! 'docs/docs', 'docs' url.sub! 'docs/docs', 'docs'