Update MDN scrapers

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

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

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

Loading…
Cancel
Save