docs(component-index): add prop descriptions

This commit is contained in:
Eric Liu 2020-10-16 14:16:49 -07:00
commit c7f664c7fb
2 changed files with 1037 additions and 1012 deletions

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,8 @@ const toMdLink = (text) => `[${text}](#${toLink(text)})`;
const formatType = (type) => `<code>${type.replace(/\|/g, "&#124;")}</code>`;
const HEADER_PROPS = "| Prop name | Type | Default value |\n| :- | :- | :- |\n";
const HEADER_PROPS =
"| Prop name | Type | Default value | Description |\n| :- | :- | :- | :- |\n";
/**
* Use library component metadata to generate component documentation in markdown format.
@ -62,7 +63,9 @@ export function generateIndex(components, groups, pkg) {
exported_props.forEach((prop, name) => {
code += `| ${name}${
prop.kind === "const" ? " (`constant`)" : ""
} | ${formatType(prop.type)} | ${prop.value || "--"}|\n`;
} | ${formatType(prop.type)} | ${prop.value || "--"} | ${
prop.description
} |\n`;
});
} else {
code += "No exported props.\n\n";