* The command reference: the parameters as a table, with their type and whether they are required (#5237)
The command reference shows each command's parameters as one raw line of
registry notation, so a reader has to read it as code to learn what a
command takes. The generated page now lists the same parameters as a table:
the name, the type, whether the command needs it, and what the registry
says about it. The complete parameter text stays in the automation details,
so nothing is lost for the scripts that read it.
The table is generated from the command registry, like the rest of the page,
so it cannot drift from the commands. The notation is read by a small parser
that knows what the registry writes: names written apart share the type
that follows them, a question mark marks a parameter optional, a pipe
between names offers alternative names for one parameter, a pipe after the
colon lists the types it accepts, a parenthesis says what the parameter
does, and the text after an arrow is the reply the command gives, not a
parameter.
Co-Authored-By: Claude <noreply@anthropic.com>
* test: the parameter table keeps its description literal
The parameter table shows registry text, so a description that carries
inline Markdown must be shown literally: backticks, emphasis and links
are characters, not syntax.
The type of a parameter ends where its sentence ends, so the sentence
that follows it is not part of the type.
Both tests fail on the current code.
* fix: render the parameter description as prose
The description cell of the parameter table is registry text, and the
rest of the file already renders registry text with prose(): backticks,
emphasis and links are characters, not syntax. table_cell() only kept
the table and the page intact, so a description like `#name = expression`
came out as a code span and a description with `*bold*` came out as
emphasis.
The name and the type keep table_cell(): they are identifiers and
notation, and they are not Markdown prose.
* fix: cut the parameter type at the end of the sentence
A type runs to the end of the clause, so the sentence that follows it
belongs to the command, not to the type: `construction?: bool. Returns
sides {bottom, right, top, left}` showed the whole sentence as the type
of `construction`, and the description of `sides` with it.
The type now ends at a full stop followed by a space and a capital
letter. A dotted or multiword type such as `sketch.rectangle` or
`number or expression` does not match that pattern, so it keeps its
current handling.
---------
Co-authored-by: Claude <noreply@anthropic.com>