I'm looking for a machine-readable reference of JavaScript classes (members, methods, parameters...), especially related to the HTML5 standard (canvas, storage, etc.).
All I have found so far is the specs on the W3C site, which include a part of the specification, f.i. http://dev.w3.org/html5/2dcontext/ has in it the Web IDL for CanvasRenderingContext2D, and other pages have other portions.
But I must be blind as I couldn't find some global index/summary with all the valid IDLs sorted and classified by version/drafts/etc.
Anyone know where it can be found?
HTML5 is still changing, so any official reference bar the spec is almost inevitably going to be out of date.
Your best bet is to suck the data straight out of the spec. Parse the file and then extract all the pre
elements with class idl
. That's your machine readable list. Guaranteed official and up-to-date.
Asked Ian Hickson (editor of the spec at the time of this answer), here is an edited summary of his reply:
There is not a single document that contains all the IDL fragments, no.
[so the HTML spec documents constitute the reference for WebIDL]
FWIW, I recommend using this source:
http://whatwg.org/c
It's more canonical than the W3C copies.
A blind extraction [of the <pre class="idl"> elements] should mostly work. It'll need a little massaging, but not much. Make sure to exclude the class="idl extract" blocks.
I actually do do a blind extraction as part of the spec generation process, to verify that the IDL syntax is correct (or rather, that all the mistakes are intentional... I occasionally use syntax that isn't specced in the WebIDL spec yet).
Not sure if it is WebIDL, but the WebKit Source has lots .idl
files mixed in with the .cpp
and .h
files. You can browse the source online. Start at WebCore and dig into some of the subdirectories.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With