devdocs/lib/docs/scrapers/immutable.rb

36 lines
896 B
Ruby
Raw Permalink Normal View History

module Docs
class Immutable < UrlScraper
self.name = 'Immutable.js'
self.slug = 'immutable'
2018-10-07 17:07:55 +02:00
self.type = 'simple'
self.release = '4.2.1'
self.base_url = "https://immutable-js.com/docs/v#{release}/"
self.links = {
home: 'https://immutable-js.com/',
code: 'https://github.com/facebook/immutable-js'
}
html_filters.push 'immutable/clean_html', 'immutable/entries'
options[:container] = '.docContents'
options[:root_title] = 'Immutable.js'
options[:trailing_slash] = true
options[:fix_urls] = ->(url) do
url.sub! '/index.html', ''
url.sub! '/index', ''
url
end
options[:attribution] = <<-HTML
&copy; 2014present, Lee Byron and other contributors<br>
Licensed under the 3-clause BSD License.
HTML
2019-03-10 03:02:24 +01:00
def get_latest_version(opts)
get_npm_version('immutable', opts)
end
end
end