2015-08-08 18:49:18 +02:00
|
|
|
module Docs
|
2017-10-09 16:52:15 +02:00
|
|
|
class ReactNative < UrlScraper
|
2022-01-12 21:55:55 +01:00
|
|
|
self.name = 'React Native'
|
2015-08-08 18:49:18 +02:00
|
|
|
self.slug = 'react_native'
|
2017-10-09 16:52:15 +02:00
|
|
|
self.type = 'react_native'
|
2022-08-27 20:16:48 +02:00
|
|
|
self.release = '0.69'
|
2022-01-12 21:55:55 +01:00
|
|
|
self.base_url = 'https://reactnative.dev/docs/'
|
2015-08-08 18:49:18 +02:00
|
|
|
self.root_path = 'getting-started.html'
|
|
|
|
self.links = {
|
2022-01-12 21:55:55 +01:00
|
|
|
home: 'https://reactnative.dev/',
|
2015-08-08 18:49:18 +02:00
|
|
|
code: 'https://github.com/facebook/react-native'
|
|
|
|
}
|
|
|
|
|
2017-10-09 16:52:15 +02:00
|
|
|
html_filters.push 'react_native/entries', 'react_native/clean_html'
|
2016-05-15 14:35:19 +02:00
|
|
|
|
2022-01-12 21:55:55 +01:00
|
|
|
options[:skip_patterns] = [/\Asample\-/, /\A0\./, /\Anext\b/]
|
2015-08-08 18:49:18 +02:00
|
|
|
options[:skip] = %w(
|
|
|
|
videos.html
|
|
|
|
transforms.html
|
2016-07-10 22:02:04 +02:00
|
|
|
troubleshooting.html
|
|
|
|
more-resources.html
|
|
|
|
)
|
2015-08-08 18:49:18 +02:00
|
|
|
|
2016-02-28 22:27:45 +01:00
|
|
|
options[:fix_urls] = ->(url) {
|
|
|
|
url.sub! 'docs/docs', 'docs'
|
|
|
|
url
|
|
|
|
}
|
|
|
|
|
2022-01-12 21:55:55 +01:00
|
|
|
# https://github.com/facebook/react-native-website/blob/main/LICENSE-docs
|
2015-08-08 18:49:18 +02:00
|
|
|
options[:attribution] = <<-HTML
|
2022-01-12 21:55:55 +01:00
|
|
|
© 2022 Facebook Inc.<br>
|
2015-08-08 18:49:18 +02:00
|
|
|
Licensed under the Creative Commons Attribution 4.0 International Public License.
|
|
|
|
HTML
|
2019-03-09 20:22:48 +01:00
|
|
|
|
2019-03-10 03:02:24 +01:00
|
|
|
def get_latest_version(opts)
|
2020-11-06 22:51:23 +01:00
|
|
|
doc = fetch_doc('https://reactnative.dev/docs/getting-started', opts)
|
|
|
|
doc.at_css('meta[name="docsearch:version"]')['content']
|
2019-03-09 20:22:48 +01:00
|
|
|
end
|
2015-08-08 18:49:18 +02:00
|
|
|
end
|
|
|
|
end
|