Skip to content

Commit

Permalink
Update docs gen
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUltDev committed Jun 7, 2024
1 parent 9c6efcb commit b0b8a79
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions toolkit/vocs/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,15 @@ async function processComponents(files: string[], paths: string[]) {
if (demo) mdx = mdx.replace(/:::demo(.*?):::/gs, demo.trim());
if (imports) mdx = mdx.replace(/:::imports(.*?):::/gs, imports.trim());
mdx = mdx.replace(/:::usage:::/g, getCodeBlock(componentName, imports, demo));
const final = getDefaultImports(componentName) + '\n' + mdx;
const final = getDefaultImports() + '\n' + mdx;
await ensureDir([output, ...base.split('/')].slice(0, -1).join('/'));
await writeFile(`${output}/${base}.mdx`, final, 'utf8');
});
}

function getDefaultImports(componentName: string) {
function getDefaultImports() {
return [
`import {Button as SB} from 'vocs/components';`,
`import {${componentName}} from 'design';`,
].join('\n');
}

Expand Down

0 comments on commit b0b8a79

Please sign in to comment.