mdn / data

This repository contains general data for Web technologies
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
720 stars 186 forks source link

Investigate: A JSON file correlating input types to their supported attributes with any useful added data #320

Open a2sheppy opened 5 years ago

a2sheppy commented 5 years ago

A JSON file that maps <input> element types to the attributes they support, as well as providing links to a page on MDN with information about each attribute and either a link to or a text field providing notes specific to given input types would give us a lot of great capabilities:

  1. We could generate and manage an index of all attributes on the main page, followed by a list of all the types each attribute works with, then sections with a summary of what each attribute does, etc.

  2. Each input type page could use a macro that lists out all the supported attributes for that input type, followed by sections for each supported attribute and their documentation through transclusion, as well as any notes or caveats specific to that input type. We gain a lot of flexibility about presentation this way.

  3. Each attribute's individual documentation page can begin with a chart or table showing which input types support it, with links to those documents.

  4. Best of all, this data could be very useful for 3rd party users of the mdn/data repository. Imagine editors that are able to accurately list out the supported attributes for the specific input type being used, or give you the warnings or notes for that combination of type and attribute, etc.

This is not something that I will look into as part of my current cleanup of the attribute documentation, but it's something that I think would make another leap forward in the usefulness and quality of (not to mention ease of future maintenance of) the input documentation.

octref commented 5 years ago

😉 https://github.com/w3c/webcomponents/issues/776

octref commented 5 years ago

Also here's how VS Code's HTML is doing it. I'm sure many of the tag / attr definitions are outdated. Would be great if I can import the most up-to-date ones from MDN!