mapcomplete/scripts/generateDocs.ts

22 lines
682 B
TypeScript
Raw Normal View History

import {Utils} from "../Utils";
Utils.runningFromConsole = true;
import SpecialVisualizations from "../UI/SpecialVisualizations";
import {existsSync, mkdirSync, readFileSync, writeFile, writeFileSync} from "fs";
2021-03-22 01:06:24 +01:00
import {UIElement} from "../UI/UIElement";
import MetaTagging from "../Logic/MetaTagging";
2021-03-22 01:06:24 +01:00
const TurndownService = require('turndown')
function WriteFile(filename, html: UIElement) : void {
const md = new TurndownService().turndown(html.InnerRender());
writeFileSync(filename, md);
}
WriteFile("./Docs/SpecialRenderings.md", SpecialVisualizations.HelpMessage)
// WriteFile("./Docs/CalculatedTags.md", MetaTagging.HelpText())
console.log("Generated docs")