mdn.rb 688 B

123456789101112131415161718192021222324
  1. module Docs
  2. class Mdn < UrlScraper
  3. self.abstract = true
  4. self.type = 'mdn'
  5. html_filters.push 'mdn/clean_html'
  6. options[:container] = '#content > .main-page-content'
  7. options[:trailing_slash] = false
  8. options[:skip_link] = ->(link) {
  9. link['title'].try(:include?, 'not yet been written'.freeze) && !link['href'].try(:include?, 'transform-function'.freeze)
  10. }
  11. options[:attribution] = <<-HTML
  12. &copy; 2005&ndash;2021 MDN contributors.<br>
  13. Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
  14. HTML
  15. def get_latest_version(opts)
  16. get_latest_github_commit_date('mdn', 'content', opts)
  17. end
  18. end
  19. end