diff --git a/Customizations/SharedTagRenderings.ts b/Customizations/SharedTagRenderings.ts index 3ad71b8fd..3f0288748 100644 --- a/Customizations/SharedTagRenderings.ts +++ b/Customizations/SharedTagRenderings.ts @@ -3,6 +3,11 @@ import * as icons from "../assets/tagRenderings/icons.json"; import {Utils} from "../Utils"; import TagRenderingConfig from "../Models/ThemeConfig/TagRenderingConfig"; import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson"; +import BaseUIElement from "../UI/BaseUIElement"; +import Combine from "../UI/Base/Combine"; +import Title from "../UI/Base/Title"; +import {FixedUiElement} from "../UI/Base/FixedUiElement"; +import List from "../UI/Base/List"; export default class SharedTagRenderings { @@ -73,4 +78,31 @@ export default class SharedTagRenderings { } + public static HelpText(): BaseUIElement { + return new Combine([ + new Combine([ + + new Title("Builtin questions",1), + + "The following items can be easily reused in your layers" + ]).SetClass("flex flex-col"), + + ... Array.from( SharedTagRenderings.SharedTagRendering.keys()).map(key => { + const tr = SharedTagRenderings.SharedTagRendering.get(key) + let mappings: BaseUIElement = undefined + if(tr.mappings?.length > 0){ + mappings = new List(tr.mappings.map(m => m.then.textFor("en"))) + } + return new Combine([ + new Title(key), + tr.render?.textFor("en"), + tr.question?.textFor("en") ?? new FixedUiElement("Read-only tagrendering").SetClass("font-bold"), + mappings + ]).SetClass("flex flex-col") + + }) + + ]).SetClass("flex flex-col") + } + } diff --git a/Models/ThemeConfig/Conversion/FixImages.ts b/Models/ThemeConfig/Conversion/FixImages.ts index 90cc0dca4..79a361059 100644 --- a/Models/ThemeConfig/Conversion/FixImages.ts +++ b/Models/ThemeConfig/Conversion/FixImages.ts @@ -41,7 +41,7 @@ export class ExtractImages extends Conversion { const fromPath = Utils.CollectPath(trpath.path, foundImage) for (const img of fromPath) { if (typeof img !== "string") { - (this._isOfficial ? errors: warnings).push("Found an image path that is not a path at " + context + "." + metapath.path.join(".") + ": " + JSON.stringify(img)) + (this._isOfficial ? errors: warnings).push(context+": found an image path that is not a path at " + context + "." + metapath.path.join(".") + ": " + JSON.stringify(img)) } } allFoundImages.push(...fromPath.filter(i => typeof i === "string")) diff --git a/scripts/generateDocs.ts b/scripts/generateDocs.ts index 763b8b0e1..02856a673 100644 --- a/scripts/generateDocs.ts +++ b/scripts/generateDocs.ts @@ -16,6 +16,7 @@ import {QueryParameters} from "../Logic/Web/QueryParameters"; import QueryParameterDocumentation from "../UI/QueryParameterDocumentation"; import ScriptUtils from "./ScriptUtils"; import List from "../UI/Base/List"; +import SharedTagRenderings from "../Customizations/SharedTagRenderings"; function WriteFile(filename, html: BaseUIElement, autogenSource: string[]): void { @@ -51,6 +52,7 @@ WriteFile("./Docs/CalculatedTags.md", new Combine([new Title("Metatags", 1), ["SimpleMetaTagger", "ExtraFunction"]) WriteFile("./Docs/SpecialInputElements.md", ValidatedTextField.HelpText(), ["ValidatedTextField.ts"]); WriteFile("./Docs/BuiltinLayers.md", AllKnownLayouts.GenLayerOverviewText(), ["AllKnownLayers.ts"]) +WriteFile("./Docs/BuiltinQuestions.md", SharedTagRenderings.HelpText(), ["SharedTagRendings.ts","assets/tagRenderings/questions.json"]) { // Generate the builtinIndex which shows interlayer dependencies