Update MDN docs

pull/566/merge
Thibaut Courouble 8 years ago
parent f93ed2649f
commit 9a97067e06

@ -181,7 +181,7 @@ credits = [
'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE'
], [ ], [
'CSS<br>DOM<br>HTML<br>JavaScript<br>SVG<br>XPath', 'CSS<br>DOM<br>HTML<br>JavaScript<br>SVG<br>XPath',
'2005-2016 Mozilla Developer Network and individual contributors', '2005-2017 Mozilla Developer Network and individual contributors',
'CC BY-SA', 'CC BY-SA',
'https://creativecommons.org/licenses/by-sa/2.5/' 'https://creativecommons.org/licenses/by-sa/2.5/'
], [ ], [

@ -53,6 +53,8 @@ module Docs
type.remove! %r{\(.*\)} type.remove! %r{\(.*\)}
type.sub! 'and', '&' type.sub! 'and', '&'
type.strip! type.strip!
type = 'Scroll Snap' if type.include?('Scroll Snap')
type = 'Compositing & Blending' if type.include?('Compositing')
type = 'Animations & Transitions' if type.in?(%w(Animations Transitions)) type = 'Animations & Transitions' if type.in?(%w(Animations Transitions))
type = 'Image Values' if type == 'Image Values & Replaced Content' type = 'Image Values' if type == 'Image Values & Replaced Content'
type = 'Variables' if type == 'Custom Properties for Cascading Variables' type = 'Variables' if type == 'Custom Properties for Cascading Variables'

@ -6,8 +6,10 @@ module Docs
'EXT_' => 'WebGL', 'EXT_' => 'WebGL',
'OES_' => 'WebGL', 'OES_' => 'WebGL',
'WEBGL_' => 'WebGL', 'WEBGL_' => 'WebGL',
'Ambient Light' => 'Ambient Light',
'Battery Status' => 'Battery Status', 'Battery Status' => 'Battery Status',
'Canvas ' => 'Canvas', 'Canvas ' => 'Canvas',
'Cooperative Scheduling' => 'Scheduling',
'CSS Font Loading' => 'CSS', 'CSS Font Loading' => 'CSS',
'CSS Object Model' => 'CSS', 'CSS Object Model' => 'CSS',
'Credential' => 'Credential Management', 'Credential' => 'Credential Management',
@ -40,6 +42,7 @@ module Docs
'Web Animations' => 'Animation', 'Web Animations' => 'Animation',
'Web App Manifest' => 'Web App Manifest', 'Web App Manifest' => 'Web App Manifest',
'Web Audio' => 'Web Audio', 'Web Audio' => 'Web Audio',
'Web Budget' => 'Web Budget',
'Web Messaging' => 'Web Messaging', 'Web Messaging' => 'Web Messaging',
'Web MIDI' => 'Web MIDI', 'Web MIDI' => 'Web MIDI',
'Web Speech' => 'Web Speech', 'Web Speech' => 'Web Speech',
@ -50,12 +53,15 @@ module Docs
'WebVR' => 'WebVR' } 'WebVR' => 'WebVR' }
TYPE_BY_NAME_STARTS_WITH = { TYPE_BY_NAME_STARTS_WITH = {
'Ambient' => 'Ambient Light',
'Audio' => 'Web Audio', 'Audio' => 'Web Audio',
'Broadcast' => 'Broadcast Channel', 'Broadcast' => 'Broadcast Channel',
'Budget' => 'Web Budget',
'Canvas' => 'Canvas', 'Canvas' => 'Canvas',
'CSS' => 'CSS', 'CSS' => 'CSS',
'ChildNode' => 'Node', 'ChildNode' => 'Node',
'console' => 'Console', 'console' => 'Console',
'CustomElement' => 'Custom Elements',
'DataTransfer' => 'Drag & Drop', 'DataTransfer' => 'Drag & Drop',
'document' => 'Document', 'document' => 'Document',
'DocumentFragment' => 'DocumentFragment', 'DocumentFragment' => 'DocumentFragment',

@ -51,7 +51,7 @@ module Docs
'Classes' 'Classes'
elsif slug.start_with? 'Errors' elsif slug.start_with? 'Errors'
'Errors' 'Errors'
elsif slug.start_with?('Functions') || slug.include?('GeneratorFunction') elsif slug.start_with?('Functions') || slug.include?('GeneratorFunction') || slug.include?('AsyncFunction')
'Function' 'Function'
elsif slug.start_with? 'Global_Objects' elsif slug.start_with? 'Global_Objects'
object, method = *slug.remove('Global_Objects/').split('/') object, method = *slug.remove('Global_Objects/').split('/')
@ -77,7 +77,7 @@ module Docs
%w(arithmetic assignment bitwise comparison logical).each do |s| %w(arithmetic assignment bitwise comparison logical).each do |s|
css("a[href^='operators/#{s}_operators#']").each do |node| css("a[href^='operators/#{s}_operators#']").each do |node|
name = node.content.strip name = CGI::unescapeHTML(node.content.strip)
name.remove! %r{[a-zA-Z]} name.remove! %r{[a-zA-Z]}
name.strip! name.strip!
entries << [name, node['href'], 'Operators'] entries << [name, node['href'], 'Operators']

@ -8,7 +8,7 @@ module Docs
options[:root_title] = 'CSS' options[:root_title] = 'CSS'
options[:skip] = %w(/CSS3 /Media/Visual /paged_media) options[:skip] = %w(/CSS3 /Media/Visual /paged_media /Media/TV /Media/Tactile)
options[:skip] += %w(/mq-boolean /single-transition-timing-function) # bug options[:skip] += %w(/mq-boolean /single-transition-timing-function) # bug
options[:skip_patterns] = [/Extensions/, /Tools/, /@media\/-webkit/, /webkit-mask/, /-moz-system-metric/] options[:skip_patterns] = [/Extensions/, /Tools/, /@media\/-webkit/, /webkit-mask/, /-moz-system-metric/]

@ -12,11 +12,11 @@ module Docs
options[:trailing_slash] = false options[:trailing_slash] = false
options[:skip_link] = ->(link) { options[:skip_link] = ->(link) {
link['title'].try(:include?, 'written'.freeze) && !link['href'].try(:include?, 'transform-function'.freeze) link['title'].try(:include?, 'not yet been written'.freeze) && !link['href'].try(:include?, 'transform-function'.freeze)
} }
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2016 Mozilla Contributors<br> &copy; 2005&ndash;2017 Mozilla Developer Network and individual contributors.<br>
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later. Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
HTML HTML

Loading…
Cancel
Save