-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider alternate styling/linking for method argument definitions #574
Comments
Note that the current style has been a compromise for not inducing too much change at a time during last year. I'd prefer alternative 1 (closest to prose) or 3 (concise, but the main text is in Description, which is less readable in the limited space), 2 (not preferred). |
I like option 1, but can we have the bold weight for identifiers while keeping the font size of the current form? Otherwise the words (graph, inputs, outputs) look awkwardly smaller from the rest of the text, which doesn't help readability. Option 2 is meh, preferring the bulleted list of 1 (though I can't articulate exactly why I prefer it 🤔, maybe just because I'm more used to it). Option 3 is quite okay too (can visually scan the field/parameter name and type really quickly), except that the nullable and optional columns squeeze the description text into narrow columns 🤏🔎👀 (same feedback as Zoltan). |
Yeah, it's just CSS - we can bump up the font size / override whatever's making it small. |
FYI, I've experimented more with (1) locally. A few notes for posterity:
|
It turns out you can do
... and both IDL methods get linked correctly. Tedious but doable. |
This can now be addressed via an additional lint rule. |
Also adds a lint rule to enforce that every argument given in IDL is linked to a prose definition for it, and a lint rule to look for argument definitions that don't match their methods. Fixes webmachinelearning#574
Method arguments are currently detailed with this markdown (using compute() as an example):
which renders as:

There are a few other forms used in other specs worth considering to improve maintainability.
Alternative 1: Make args into definitions
A minimal change makes the argument names become definitions which are get automatically linked, to help catch errors.
which renders as:

Alternative 2: Style as definition list
Extending the above using a definition list, similar to what is currently done for dictionaries:
which renders as:

Alternative 3: Auto-generated table
This is a much more radical departure from what the spec has today. The spec source is extremely compact, which eases maintenance. Argument type, nullability, and optionality are filled in by Bikeshed automatically, reducing errors. On the flip side, I personally find the big table ugly.
which renders as:

Note that for all of these the return value of the method is not handled.
The text was updated successfully, but these errors were encountered: