mirror of https://github.com/freeCodeCamp/devdocs
commit
296a7e03e2
@ -1,29 +1,30 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Redux
|
class Redux
|
||||||
class EntriesFilter < Docs::EntriesFilter
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
|
||||||
def get_name
|
def get_name
|
||||||
name = at_css('.page-inner h1, .page-inner h2').content
|
name = at_css('h1').content
|
||||||
name.sub! %r{\(.*\)}, '()'
|
name.gsub(/\(.*\)/, '()')
|
||||||
name
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_type
|
def get_type
|
||||||
path = slug.split('/')
|
slug.match?(/\Astore\Z/) ? 'Store API' : 'Top-Level Exports'
|
||||||
|
|
||||||
if path.length > 1
|
|
||||||
path[0].titleize.sub('Api', 'API').sub('Faq', 'FAQ')
|
|
||||||
else
|
|
||||||
'Miscellaneous'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def additional_entries
|
def additional_entries
|
||||||
css('#store-methods + ul > li > a').map do |node|
|
entries = []
|
||||||
id = node['href'].remove('#')
|
|
||||||
name = "#{self.name}##{id}()"
|
if slug.match?(/\Astore\Z/)
|
||||||
[name, id]
|
css('h3').each do |node|
|
||||||
|
entry_path = node.content.gsub(/\(|\)/, '')
|
||||||
|
entry_name = node.content.gsub(/\(.*\)/, '()')
|
||||||
|
entries << [entry_name, entry_path.downcase, 'Store API']
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
entries
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,28 +1,34 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Redux < UrlScraper
|
class Redux < UrlScraper
|
||||||
|
|
||||||
self.type = 'simple'
|
self.type = 'simple'
|
||||||
self.release = '3.7.2'
|
self.base_url = 'https://redux.js.org/api'
|
||||||
self.base_url = 'http://redux.js.org/docs/'
|
self.root_path = 'index.html'
|
||||||
self.links = {
|
self.links = {
|
||||||
home: 'http://redux.js.org/',
|
home: 'http://redux.js.org/',
|
||||||
code: 'https://github.com/reactjs/redux/'
|
code: 'https://github.com/reduxjs/redux/'
|
||||||
}
|
}
|
||||||
|
|
||||||
html_filters.push 'redux/entries', 'redux/clean_html'
|
html_filters.push 'redux/clean_html', 'redux/entries'
|
||||||
|
|
||||||
options[:skip] = %w(Feedback.html)
|
options[:container] = '.markdown'
|
||||||
|
|
||||||
options[:attribution] = <<-HTML
|
options[:attribution] = <<-HTML
|
||||||
© 2015–2017 Dan Abramov<br>
|
© 2015–2020 Dan Abramov<br>
|
||||||
Licensed under the MIT License.
|
Licensed under the MIT License.
|
||||||
HTML
|
HTML
|
||||||
|
|
||||||
stub '' do
|
version do
|
||||||
request_one('http://redux.js.org/index.html').body
|
self.release = '4.0.5'
|
||||||
|
end
|
||||||
|
|
||||||
|
version '3' do
|
||||||
|
self.release = '3.7.2'
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_latest_version(opts)
|
def get_latest_version(opts)
|
||||||
get_npm_version('redux', opts)
|
get_npm_version('redux', opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in new issue