Update and improve React Native documentation (0.10.0)

pull/241/merge
Thibaut 10 years ago
parent 2145350075
commit 9cfb3c61e6

@ -5,4 +5,7 @@
code { @extend %label; }
blockquote { @extend %note; }
span.platform { float: right; }
span.propType, span.platform { font-weight: normal; }
}

@ -21,12 +21,13 @@ module Docs
link = at_css('.nav-docs-section .active')
section = link.ancestors('.nav-docs-section').first
type = section.at_css('h3').content.strip
REPLACE_TYPES[type] || type
type = REPLACE_TYPES[type] || type
type += ": #{name}" if type == 'Components'
type
end
def additional_entries
return [] unless API_SLUGS.include?(slug)
if API_SLUGS.include?(slug)
css('.inner-content h3, .inner-content h4').map do |node|
name = node.content
name.remove! %r{[#\(\)]}
@ -35,6 +36,17 @@ module Docs
type = slug.include?('component') ? 'Component' : 'React'
[name, id, type]
end
else
css('.props > .prop > .propTitle').each_with_object([]) do |node, entries|
name = node.children.find(&:text?).try(:content)
next if name.blank?
sep = node.content.include?('static') ? '.' : '#'
name.prepend(self.name + sep)
name << '()' if node.css('.propType').last.content.start_with?('(')
id = node.at_css('.anchor')['name']
entries << [name, id]
end
end
end
end
end

@ -3,7 +3,7 @@ module Docs
self.name = 'React Native'
self.slug = 'react_native'
self.type = 'react'
self.version = '0.8.0'
self.version = '0.10.0'
self.base_url = 'https://facebook.github.io/react-native/docs/'
self.root_path = 'getting-started.html'
self.links = {

Loading…
Cancel
Save