devdocs/lib/docs/scrapers/underscore.rb
2019-03-09 20:22:48 +01:00

30 lines
903 B
Ruby

module Docs
class Underscore < UrlScraper
self.name = 'Underscore.js'
self.slug = 'underscore'
self.type = 'underscore'
self.release = '1.9.1'
self.base_url = 'https://underscorejs.org'
self.links = {
home: 'https://underscorejs.org',
code: 'https://github.com/jashkenas/underscore'
}
html_filters.push 'underscore/clean_html', 'underscore/entries', 'title'
options[:title] = 'Underscore.js'
options[:container] = '#documentation'
options[:skip_links] = true
options[:attribution] = <<-HTML
&copy; 2009&ndash;2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters &amp; Editors<br>
Licensed under the MIT License.
HTML
def get_latest_version(options, &block)
fetch_doc('https://underscorejs.org/', options) do |doc|
block.call doc.at_css('.version').content[1...-1]
end
end
end
end