-
Notifications
You must be signed in to change notification settings - Fork 1
/
mdn.rb
29 lines (24 loc) · 933 Bytes
/
mdn.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module Docs
class Mdn < UrlScraper
self.abstract = true
self.type = 'mdn'
self.links = {
home: 'https://developer.mozilla.org',
code: 'https://github.com/mdn/content'
}
html_filters.insert_before 'container', 'mdn/compat_tables' # needs access to <script type="application/json" id="hydration">
html_filters.push 'mdn/clean_html'
options[:container] = '#content > .main-page-content'
options[:trailing_slash] = false
options[:skip_link] = ->(link) {
link['title'].try(:include?, 'not yet been written'.freeze) && !link['href'].try(:include?, 'transform-function'.freeze)
}
options[:attribution] = <<-HTML
© 2005–2023 MDN contributors.<br>
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
end
end