Codex's demo site, powered by VitePress, uses vue-docgen-cli to automatically pull component props, events, slots, and public methods docs from .vue files and output them as tables on component demo pages.
The output can be customized via templates, just like we're customizing the entire component demo page with a template. See the templates property of the DocgenCLIConfig object.
We should make some improvements to the default output:
- Events: it's nice to document the properties that are included in emitted events, but all attributes are required, which seems silly for extremely self-explanatory events. For example, when the TextInput's input event is emitted, it comes with an event property with type InputEvent that is...the input event. It's silly to include a description for this property since it's so self-explanatory. However, if you leave anything (property name, type, description) out, the word "undefined" is rendered instead. We should at least make the description optional to avoid redundancy.
- Methods: the use of headings, blockquotes, and a table for params is weird and hard to read:
- Props with default value returned by function: maybe we can just show the return value:
Acceptance Criteria
- Event property descriptions are optional
- Method documentation is clear and useful
- Output for default value of prop returned by a function is improved