mapcomplete/scripts/generateDocs.ts

26 lines
936 B
TypeScript
Raw 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";
import ValidatedTextField from "../UI/Input/ValidatedTextField";
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 {
2021-06-10 01:36:20 +02:00
const md = new TurndownService().turndown(html.InnerRenderAsString());
2021-03-22 01:06:24 +01:00
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-05-19 12:49:51 +02:00
writeFileSync("./Docs/SpecialInputElements.md", ValidatedTextField.HelpText());
2021-03-22 01:06:24 +01:00
console.log("Generated docs")