Skip to content

Commit

Permalink
docs: Fix anchor links in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Jun 19, 2023
1 parent 2d6fc24 commit 456e319
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/dev-utils/src/generate-documentation-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,21 +370,19 @@ function generateTableOfContents(

function generateDescriptions(
parentName: string | undefined,
parentId: string,
nodes: OptionDocumentation[]
): string {
return nodes
.map((node) => {
const name = parentName === undefined ? node.name : `${parentName}.${node.name}`;
const id = `${parentId}-${node.name.toLowerCase()}`;
let output = `### \`${name}\`
${node.type === undefined ? "" : `Type: \`${node.type}\``}
${node.fullDescription}
`;
if (node.children) {
output += generateDescriptions(name, id, node.children);
output += generateDescriptions(name, node.children);
}
return output;
})
Expand All @@ -394,8 +392,8 @@ ${node.fullDescription}
export function generateOptionsDocumentation(): string {
return `## Options
${generateTableOfContents(0, "option", options)}
${generateTableOfContents(0, "", options)}
${generateDescriptions(undefined, "option", options)}
${generateDescriptions(undefined, options)}
`;
}

0 comments on commit 456e319

Please sign in to comment.