carbon-components-svelte/scripts/build-docs.js
Eric Liu e37b632fef
build: decouple typegen/docgen from yarn build:lib (#1038)
* chore(deps-dev): upgrade sveld to v0.13.1

* build: separate sveld into a separate build script

* docs(contributing): update guideline on re-building docs
2022-01-24 14:16:31 -08:00

20 lines
446 B
JavaScript

const { sveld } = require("sveld");
const pkg = require("../package.json");
sveld({
glob: true,
markdown: true,
markdownOptions: {
onAppend: (type, document, components) => {
if (type === "h1")
document.append(
"quote",
`${components.size} components exported from ${pkg.name}@${pkg.version}.`
);
},
},
json: true,
jsonOptions: {
outFile: "docs/src/COMPONENT_API.json",
},
});