w3c / reffy

Reffy is a Web spec crawler and analyzer tool. It is notably used to update Webref
MIT License
70 stars 23 forks source link

Consider extracts per IDL fragment with the "full" interface #472

Open tidoust opened 3 years ago

tidoust commented 3 years ago

See discussion in https://github.com/w3c/respec/issues/3264

As noted there, the information about partial interfaces defined in a given spec is already available in idlparsed extracts under the idlExtendedNames property. It is relatively easy to build a view per interface that agglomerates base and partial (and mixin) definitions. One still needs to parse all extracts to build that view.

To avoid putting the burden on authoring tools, and since the information could also be useful for other types of tools (e.g. type annotation tools), it may be useful to build these views directly as extracts.

For each IDL fragment, we could annotate and merge the info in idlparsed to a common JSON structure so that one may serialize that info into whatever format needed. It may also be useful to also include a textual rendering of the full interface as if it were defined in a single Web IDL block.

It probably does not make sense to generate an HTML representation because most tools would probably want to tweak that representation to their liking in any case.

tidoust commented 3 years ago

Notes on follow-up discussion:

In both cases, we will have to come up with a rule to order partial definitions. Something like: base definition first, WebIDL parser AST order when a name appears multiple times in a given spec, and order of the specs in browser-specs.