History

mdn: update CSS, HTML, JavaScript, SVG, XSLT&XPath

Simon Legner committed 5 years ago

Commit 04db81e1 parent b5032413 files · +6 −7Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. lib/docs/scrapers/mdn/mdn.rb +4 −2
  3. lib/docs/scrapers/mdn/xslt_xpath.rb +1 −4
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -203,7 +203,7 @@ credits = [ · 202 unmodified lines
203 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE'203 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE'
204 ], [204 ], [
205 'CSS<br>DOM<br>HTTP<br>HTML<br>JavaScript<br>SVG<br>XPath',205 'CSS<br>DOM<br>HTTP<br>HTML<br>JavaScript<br>SVG<br>XPath',
206 '2005-2017 Mozilla Developer Network and individual contributors',206 '2005-2020 Mozilla and individual contributors',
207 'CC BY-SA',207 'CC BY-SA',
208 'https://creativecommons.org/licenses/by-sa/2.5/'208 'https://creativecommons.org/licenses/by-sa/2.5/'
209 ], [209 ], [
lib/docs/scrapers/mdn/mdn.rb+4−2
@@ -17,18 +17,20 @@ module Docs · 16 unmodified lines
17 }17 }
18 18
19 options[:attribution] = <<-HTML19 options[:attribution] = <<-HTML
20 &copy; 2005&ndash;2018 Mozilla Developer Network and individual contributors.<br>20 &copy; 2005&ndash;2020 Mozilla and individual contributors.<br>
21 Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.21 Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
22 HTML22 HTML
23 23
24 def get_latest_version(opts)24 def get_latest_version(opts)
25 json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)25 json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)
26 DateTime.parse(json[0]['pubdate']).to_time.to_i26 dates = json.map { |i| i['pubdate'] }
27 DateTime.parse(dates.max).to_time.to_i
27 end28 end
28 29
29 private30 private
30 31
31 def process_response?(response)32 def process_response?(response)
33 response.effective_url.host = 'developer.mozilla.org' if response.effective_url.host == 'wiki.developer.mozilla.org'
32 super && response.effective_url.query == 'raw=1&macros=1'34 super && response.effective_url.query == 'raw=1&macros=1'
33 end35 end
34 end36 end
lib/docs/scrapers/mdn/xslt_xpath.rb+1−4
@@ -15,10 +15,7 @@ module Docs · 14 unmodified lines
15 options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]15 options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
16 16
17 options[:fix_urls] = ->(url) do17 options[:fix_urls] = ->(url) do
18 url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath"18 url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT"
19 url.sub! 'https://developer.mozilla.org/en/XSLT', "#{XsltXpath.base_url}/XSLT"
20 url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', "#{XsltXpath.base_url}/XPath"
21 url.sub! 'https://developer.mozilla.org/en-US/docs/XSLT', "#{XsltXpath.base_url}/XSLT"
22 url19 url
23 end20 end
24 end21 end