Update MDN scrapers

pull/210/merge
Thibaut 10 years ago
parent 329dfea923
commit bd52c74d1f

@ -12,6 +12,7 @@ module Docs
'Fetch' => 'Fetch', 'Fetch' => 'Fetch',
'File API' => 'File', 'File API' => 'File',
'Geolocation' => 'Geolocation', 'Geolocation' => 'Geolocation',
'Geometry' => 'Geometry',
'Media Capture' => 'Media', 'Media Capture' => 'Media',
'Media Source' => 'Media', 'Media Source' => 'Media',
'MediaStream' => 'Media', 'MediaStream' => 'Media',
@ -24,7 +25,8 @@ module Docs
'Web Messaging' => 'Web Messaging', 'Web Messaging' => 'Web Messaging',
'Web Storage' => 'Web Storage', 'Web Storage' => 'Web Storage',
'Web Workers' => 'Web Workers', 'Web Workers' => 'Web Workers',
'WebRTC' => 'WebRTC' } 'WebRTC' => 'WebRTC',
'WebVR' => 'WebVR' }
TYPE_BY_NAME_STARTS_WITH = { TYPE_BY_NAME_STARTS_WITH = {
'Audio' => 'Web Audio', 'Audio' => 'Web Audio',
@ -51,6 +53,7 @@ module Docs
'Node' => 'Node', 'Node' => 'Node',
'Notification' => 'Notification', 'Notification' => 'Notification',
'ParentNode' => 'Node', 'ParentNode' => 'Node',
'Push' => 'Push',
'Range' => 'Range', 'Range' => 'Range',
'RTC' => 'WebRTC', 'RTC' => 'WebRTC',
'screen' => 'Screen', 'screen' => 'Screen',
@ -79,6 +82,7 @@ module Docs
'TextMetrics' => 'Canvas', 'TextMetrics' => 'Canvas',
'udio' => 'Web Audio', 'udio' => 'Web Audio',
'WebGL' => 'Canvas', 'WebGL' => 'Canvas',
'WebVR' => 'WebVR',
'Worker' => 'Web Workers' } 'Worker' => 'Web Workers' }
TYPE_BY_NAME_MATCHES = {} TYPE_BY_NAME_MATCHES = {}

@ -2,8 +2,8 @@ module Docs
class Javascript class Javascript
class EntriesFilter < Docs::EntriesFilter class EntriesFilter < Docs::EntriesFilter
TYPES = %w(Array ArrayBuffer Boolean DataView Date Function Intl JSON Map TYPES = %w(Array ArrayBuffer Boolean DataView Date Function Intl JSON Map
Math Number Object Promise RegExp Set String Symbol TypedArray WeakMap Math Number Object Promise RegExp Set SIMD String Symbol TypedArray
WeakSet) WeakMap WeakSet)
INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat) INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat)
def get_name def get_name
@ -21,6 +21,7 @@ module Docs
name name
else else
name = super name = super
name.remove! 'Classes.'
name.remove! 'Functions.' name.remove! 'Functions.'
name.remove! 'Functions and function scope.' name.remove! 'Functions and function scope.'
name.remove! 'Operators.' name.remove! 'Operators.'
@ -34,6 +35,8 @@ module Docs
'Statements' 'Statements'
elsif slug.start_with? 'Operators' elsif slug.start_with? 'Operators'
'Operators' 'Operators'
elsif slug.start_with? 'Classes'
'Classes'
elsif slug.start_with?('Functions_and_function_scope') || slug.start_with?('Functions') || slug.include?('GeneratorFunction') elsif slug.start_with?('Functions_and_function_scope') || slug.start_with?('Functions') || slug.include?('GeneratorFunction')
'Function' 'Function'
elsif slug.start_with? 'Global_Objects' elsif slug.start_with? 'Global_Objects'

Loading…
Cancel
Save