From f94dbb0a61999c84f5c621881b8eb4028014a32e Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 18 Mar 2018 19:53:19 -0400 Subject: [PATCH] Update MDN documentation --- lib/docs/filters/css/entries.rb | 1 + lib/docs/filters/dom/entries.rb | 6 +++++- lib/docs/scrapers/mdn/mdn.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/css/entries.rb b/lib/docs/filters/css/entries.rb index 00816cea..41150417 100644 --- a/lib/docs/filters/css/entries.rb +++ b/lib/docs/filters/css/entries.rb @@ -51,6 +51,7 @@ module Docs type.remove! ' Module' type.remove! %r{ Level \d\z} type.remove! %r{\(.*\)} + type.remove! %r{ \d\z} type.sub! 'and', '&' type.strip! type = 'Grid Layout' if type.include?('Grid Layout') diff --git a/lib/docs/filters/dom/entries.rb b/lib/docs/filters/dom/entries.rb index 988897c6..6d2e2ce3 100644 --- a/lib/docs/filters/dom/entries.rb +++ b/lib/docs/filters/dom/entries.rb @@ -11,6 +11,7 @@ module Docs 'Battery Status' => 'Battery Status', 'Canvas ' => 'Canvas', 'Clipboard' => 'Clipboard', + 'Content Security' => 'Content Security Policy', 'Cooperative Scheduling' => 'Scheduling', 'CSS Font Loading' => 'CSS', 'CSS Object Model' => 'CSS', @@ -50,6 +51,7 @@ module Docs 'Web Animations' => 'Animation', 'Web App Manifest' => 'Web App Manifest', 'Budget' => 'Budget', + 'Web Authentication' => 'Authentication', 'Web Workers' => 'Web Workers', 'WebGL' => 'WebGL', 'WebRTC' => 'WebRTC', @@ -74,6 +76,7 @@ module Docs 'CustomElement' => 'Custom Elements', 'DataTransfer' => 'Drag & Drop', 'document' => 'Document', + 'Document Object' => 'DOM', 'DocumentFragment' => 'DocumentFragment', 'DocumentType' => 'Nodes', 'DOM' => 'DOM', @@ -110,6 +113,7 @@ module Docs 'screen' => 'Screen', 'Selection' => 'Selection', 'Shadow' => 'Shadow DOM', + 'StaticRange' => 'Range', 'Streams' => 'Media Streams', 'StyleSheet' => 'CSS', 'Stylesheet' => 'CSS', @@ -170,7 +174,6 @@ module Docs CLEANUP_NAMES = %w( CSS\ Object\ Model. - Document\ Object\ Model. Tutorial. XMLHttpRequest. ANGLE\ instanced\ arrays.) @@ -178,6 +181,7 @@ module Docs def get_name name = super CLEANUP_NAMES.each { |str| name.remove!(str) } + name.sub! %r{Document\ Object\ Model\.}i, 'Document Object Model: ' name.sub! 'Input.', 'HTMLInputElement.' name.sub! 'window.navigator', 'navigator' name.sub! 'API.', 'API: ' diff --git a/lib/docs/scrapers/mdn/mdn.rb b/lib/docs/scrapers/mdn/mdn.rb index 15a33291..2ebd38aa 100644 --- a/lib/docs/scrapers/mdn/mdn.rb +++ b/lib/docs/scrapers/mdn/mdn.rb @@ -9,7 +9,7 @@ module Docs html_filters.push 'mdn/clean_html' text_filters.insert_before 'attribution', 'mdn/contribute_link' - options[:rate_limit] = 400 + options[:rate_limit] = 200 options[:trailing_slash] = false options[:skip_link] = ->(link) {