forked from MapComplete/MapComplete
Fix: add workaround for limited html conversion, add documentation and cleanup some code
This commit is contained in:
parent
24cb539559
commit
de402a7d84
2 changed files with 22 additions and 15 deletions
|
@ -141,7 +141,9 @@ export class GenerateDocs extends Script {
|
|||
|
||||
this.WriteMarkdownFile("./Docs/SpecialRenderings.md", SpecialVisualizations.HelpMessage(), [
|
||||
"src/UI/SpecialVisualizations.ts",
|
||||
])
|
||||
], {
|
||||
tocMaxDepth: 3
|
||||
})
|
||||
|
||||
if (!existsSync("./Docs/Themes")) {
|
||||
mkdirSync("./Docs/Themes")
|
||||
|
@ -217,7 +219,8 @@ export class GenerateDocs extends Script {
|
|||
markdown: string,
|
||||
autogenSource: string[],
|
||||
options?: {
|
||||
noTableOfContents?: boolean
|
||||
noTableOfContents?: boolean,
|
||||
tocMaxDepth?: number
|
||||
}
|
||||
): void {
|
||||
for (const source of autogenSource) {
|
||||
|
@ -236,7 +239,7 @@ export class GenerateDocs extends Script {
|
|||
let md = markdown
|
||||
|
||||
if (options?.noTableOfContents !== false) {
|
||||
md = TableOfContents.insertTocIntoMd(md)
|
||||
md = TableOfContents.insertTocIntoMd(md, options?.tocMaxDepth)
|
||||
}
|
||||
|
||||
md = md.replace(/\n\n\n+/g, "\n\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue