mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
docs(component-index): add prop descriptions
This commit is contained in:
parent
27726be070
commit
c7f664c7fb
2 changed files with 1037 additions and 1012 deletions
|
@ -4,7 +4,8 @@ const toMdLink = (text) => `[${text}](#${toLink(text)})`;
|
|||
|
||||
const formatType = (type) => `<code>${type.replace(/\|/g, "|")}</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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue