mapcomplete/scripts/generateDocs.ts

25 lines
784 B
TypeScript
Raw Permalink Normal View History

import {Utils} from "../Utils";
2021-03-24 02:01:04 +01:00
Utils.runningFromConsole = true;
import SpecialVisualizations from "../UI/SpecialVisualizations";
import {writeFileSync} from "fs";
2021-03-22 01:06:24 +01:00
import {UIElement} from "../UI/UIElement";
import SimpleMetaTagger from "../Logic/SimpleMetaTagger";
2021-03-24 02:01:04 +01:00
import Combine from "../UI/Base/Combine";
import {ExtraFunction} from "../Logic/ExtraFunction";
2021-03-24 02:01:04 +01:00
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)
2021-03-24 02:01:04 +01:00
WriteFile("./Docs/CalculatedTags.md", new Combine([SimpleMetaTagger.HelpText(), ExtraFunction.HelpText()]))
2021-03-22 01:06:24 +01:00
console.log("Generated docs")