Improve DOM scraper

pull/142/head
Thibaut 10 years ago
parent 6769c90c8a
commit fb125772b9

@ -33,6 +33,7 @@ module Docs
'File' => 'File', 'File' => 'File',
'GlobalEventHandlers' => 'GlobalEventHandlers', 'GlobalEventHandlers' => 'GlobalEventHandlers',
'history' => 'History', 'history' => 'History',
'HTML' => 'Elements',
'IDB' => 'IndexedDB', 'IDB' => 'IndexedDB',
'Location' => 'Location', 'Location' => 'Location',
'navigator' => 'Navigator', 'navigator' => 'Navigator',
@ -59,8 +60,7 @@ module Docs
'WebGL' => 'Canvas', 'WebGL' => 'Canvas',
'Worker' => 'Web Workers' } 'Worker' => 'Web Workers' }
TYPE_BY_NAME_MATCHES = { TYPE_BY_NAME_MATCHES = {}
/HTML\w*Element/ => 'Elements' }
TYPE_BY_HAS_LINK_TO = { TYPE_BY_HAS_LINK_TO = {
'DeviceOrientation specification' => 'Device Orientation', 'DeviceOrientation specification' => 'Device Orientation',
@ -75,6 +75,7 @@ module Docs
Web\ Audio\ API. Web\ Audio\ API.
IndexedDB\ API. IndexedDB\ API.
MediaRecorder\ API. MediaRecorder\ API.
Tutorial.
XMLHttpRequest.) XMLHttpRequest.)
def get_name def get_name
@ -82,6 +83,7 @@ module Docs
CLEANUP_NAMES.each { |str| name.remove!(str) } CLEANUP_NAMES.each { |str| name.remove!(str) }
name.sub! 'Input.', 'HTMLInputElement.' name.sub! 'Input.', 'HTMLInputElement.'
name.sub! 'window.navigator', 'navigator' name.sub! 'window.navigator', 'navigator'
name.sub! 'API.', 'API: '
# Comment.Comment => Comment.constructor # Comment.Comment => Comment.constructor
name.sub! %r{\A(\w+)\.\1\z}, '\1.constructor' unless name == 'window.window' name.sub! %r{\A(\w+)\.\1\z}, '\1.constructor' unless name == 'window.window'
name name

@ -35,6 +35,7 @@ module Docs
/TCPServerSocket /TCPServerSocket
/TCPSocket /TCPSocket
/TypeInfo /TypeInfo
/Using_the_Browser_API
/Web_Video_Text_Tracks_Format /Web_Video_Text_Tracks_Format
/WifiManager /WifiManager
/window.controllers /window.controllers
@ -58,7 +59,10 @@ module Docs
/gamepad/i, /gamepad/i,
/UserData/, /UserData/,
/\A\/Camera/, /\A\/Camera/,
/\A\/Data_Store_API/,
/\A\/DataStore/,
/\A\/DeviceStorage/, /\A\/DeviceStorage/,
/\A\/DocumentTouch/,
/\A\/document\.xml/, /\A\/document\.xml/,
/\A\/XMLDocument/, /\A\/XMLDocument/,
/\A\/DOMCursor/, /\A\/DOMCursor/,
@ -68,7 +72,7 @@ module Docs
/\A\/navigator\.id/i, /\A\/navigator\.id/i,
/\A\/Settings/, /\A\/Settings/,
/\A\/Telephony/, /\A\/Telephony/,
/\A\/Bluetooth/, /Bluetooth/,
/\A\/Window\.\w+bar/i, /\A\/Window\.\w+bar/i,
/\A\/Apps/, /\A\/Apps/,
/\A\/Contact/, /\A\/Contact/,
@ -95,7 +99,9 @@ module Docs
/form.elements /form.elements
/select.type /select.type
/table.rows /table.rows
/XMLHttpRequest/FormData) /XMLHttpRequest/FormData
/Performance.now
/Document_Object_Model)
options[:fix_urls] = ->(url) do options[:fix_urls] = ->(url) do
return if url.include?('_') || url.include?('?') return if url.include?('_') || url.include?('?')

Loading…
Cancel
Save