You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/scrapers/mdn/mdn.rb

30 lines
933 B

11 years ago
module Docs
class Mdn < UrlScraper
self.abstract = true
self.type = 'mdn'
self.links = {
home: 'https://developer.mozilla.org',
code: 'https://github.com/mdn/content'
}
11 years ago
html_filters.insert_before 'container', 'mdn/compat_tables' # needs access to <script type="application/json" id="hydration">
html_filters.push 'mdn/clean_html'
11 years ago
options[:container] = '#content > .main-page-content'
11 years ago
options[:trailing_slash] = false
options[:skip_link] = ->(link) {
8 years ago
link['title'].try(:include?, 'not yet been written'.freeze) && !link['href'].try(:include?, 'transform-function'.freeze)
}
options[:attribution] = <<-HTML
5 months ago
&copy; 2005&ndash;2024 MDN contributors.<br>
11 years ago
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
HTML
def get_latest_version(opts)
get_latest_github_commit_date('mdn', 'content', opts)
end
11 years ago
end
end