mirror of https://github.com/freeCodeCamp/devdocs
parent
bd6ca4b31a
commit
c12b8e4797
@ -0,0 +1,14 @@
|
||||
module Docs
|
||||
class ReactRouter
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.md-prose')
|
||||
css('pre').each do |node|
|
||||
node.content = node.css('.codeblock-line').map(&:content).join("")
|
||||
node['data-language'] = 'javascript'
|
||||
end
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
module Docs
|
||||
class ReactRouter
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
entries = []
|
||||
css('h2[id], h3[id]').each do |node|
|
||||
entries << [node.content, node['id'], 'API Reference']
|
||||
end
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,26 @@
|
||||
module Docs
|
||||
class ReactRouter < UrlScraper
|
||||
self.name = 'React Router'
|
||||
self.slug = 'react_router'
|
||||
self.type = 'simple'
|
||||
self.release = '6.2.1'
|
||||
self.base_url = 'https://reactrouterdotcom.fly.dev/docs/en/v6/api'
|
||||
|
||||
self.links = {
|
||||
home: 'https://reactrouterdotcom.fly.dev/',
|
||||
code: 'https://github.com/remix-run/react-router'
|
||||
}
|
||||
|
||||
html_filters.push 'react_router/entries', 'react_router/clean_html', 'title'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© React Training 2015-2019<br>
|
||||
© Remix Software 2020-2021<br>
|
||||
Licensed under the MIT License (MIT).
|
||||
HTML
|
||||
|
||||
def get_latest_version(opts)
|
||||
get_npm_version('react-router', opts)
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 795 B |
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1 @@
|
||||
https://reactrouterdotcom.fly.dev/favicon.ico
|
Loading…
Reference in new issue