fix: exclude JS API docs from prose docs

This commit is contained in:
Ken Snyder
2022-02-07 00:42:46 -08:00
parent e3e371d3a8
commit c34a4c693f
5 changed files with 15 additions and 7 deletions

View File

@@ -70,7 +70,11 @@ export async function parseTypescriptAst(
project.symbols.push(...parseModule(mod));
} else {
console.error(
`Detected a "${mod.kindString}" node at the root level; we would expect only Namespace/module definitions at the root level`
`- detected a ${mod.kindString} node with a name of "${
mod.name
}" at the root level; we would expect only Namespace/module definitions at the root level${
mod.comment ? `\n\tcomment: ${mod.comment}` : ""
}`
);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -53,7 +53,9 @@ function reduceClutter(
download_url: f.download_url as string,
}));
const children = resp.filter((i) => i.type === "dir").map((d) => d.name);
const children = resp
.filter((i) => i.type === "dir" && !i.name.startsWith(".") && i.name !== "api")
.map((d) => d.name);
return [files, children];
}
@@ -71,9 +73,11 @@ async function getStructure(o: IEnv) {
if (children.length > 0) {
const waitFor: Promise<IDocsSitemap>[] = [];
for (const child of children) {
if (child.startsWith("_")) {
if (child.startsWith("_" || child.startsWith(".") || child === "api")) {
// eslint-disable-next-line no-console
console.log(`- skipping the "${child}" directory due to leading underscore`);
console.log(
`- skipping the "${child}" directory due to leading directory character`
);
} else {
const p = join(o.docsPath, `/${child}`);
const mo: IEnv = { ...o, docsPath: p };