From 42ec7a1eb5a82aa4d6950b873c5aa0dc2c45a7c9 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 22 Mar 2021 01:06:24 +0100 Subject: [PATCH] Small fixes --- Logic/MetaTagging.ts | 2 +- scripts/generateDocs.ts | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index fc262e602..c0e4e2274 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -3,9 +3,9 @@ import State from "../State"; import opening_hours from "opening_hours"; import {And, Or, Tag} from "./Tags"; import {Utils} from "../Utils"; -import CountryCoder from "latlon2country" import {UIElement} from "../UI/UIElement"; import Combine from "../UI/Base/Combine"; +import CountryCoder from "latlon2country" class SimpleMetaTagger { public readonly keys: string[]; diff --git a/scripts/generateDocs.ts b/scripts/generateDocs.ts index 01d2e0823..ac8dd5e00 100644 --- a/scripts/generateDocs.ts +++ b/scripts/generateDocs.ts @@ -2,10 +2,20 @@ import {Utils} from "../Utils"; Utils.runningFromConsole = true; import SpecialVisualizations from "../UI/SpecialVisualizations"; import {existsSync, mkdirSync, readFileSync, writeFile, writeFileSync} from "fs"; +import {UIElement} from "../UI/UIElement"; +import MetaTagging from "../Logic/MetaTagging"; -const html = SpecialVisualizations.HelpMessage.InnerRender(); -var TurndownService = require('turndown') -const md = new TurndownService().turndown(html); -writeFileSync("./Docs/SpecialRenderings.md", md) -console.log("Generated docs") \ No newline at end of file +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") +