mdn.rb 824 B

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