orbit prop table generator
npm install monstraOrbit-monstra is a simple docs generator from ts declaration files for @kiwicom/orbit-components project
Available commands:
- _docs_: creates README.md files in component folder with table of props, subcomponents and description
_example_: monstra docs --path='src/*/'
How to document component:
- To create basic description add to index.d.ts next comment block:
/ DOCS:
_example:_
``
/* DOCS:
# AirportIllustration
To implement AirportIllustration component into your project you'll need to add the import:
import AirportIllustration from "@kiwicom/orbit-components/lib/AirportIllustration";
After adding import into your project you can use it simply like:
*/
`
Note: (same with / FunctionalSpec: /)
- When you run docs command it creates table with Name and Type like:
| Name | Type | Optional | Description |
| ---------- | ----------------- | ------- | ----------- |
| size | enum | | |Name
| name | | | |
in order to add description and default value, you have to add comment lines in index.d.ts file of component in JSDoc format:
`js``
export interface Props extends Globals, SpaceAfter {
/* The size of the AirportIllustration /
/* default: "small" /
readonly size?: "extraSmall" | "small" | "medium" | "large" | "display";
readonly name: Name;
readonly alt?: string;
}