Refactoring: port doc generation to generate markdown directly without UIElements

This commit is contained in:
Pieter Vander Vennet 2024-07-12 03:17:15 +02:00
parent 7a7439b161
commit 8e9c03e258
17 changed files with 309 additions and 320 deletions

View file

@ -99,15 +99,15 @@ export default class Validators {
private static _byType = Validators._byTypeConstructor()
public static HelpText(): BaseUIElement {
const explanations: BaseUIElement[] = Validators.AllValidators.map((type) =>
new Combine([new Title(type.name, 3), type.explanation]).SetClass("flex flex-col")
public static HelpText(): string {
const explanations: string[] = Validators.AllValidators.flatMap((type) =>
["### "+type.name, type.explanation]
)
return new Combine([
new Title("Available types for text fields", 1),
return [
"# Available types for text fields",
"The listed types here trigger a special input element. Use them in `tagrendering.freeform.type` of your tagrendering to activate them",
...explanations,
]).SetClass("flex flex-col")
].join("\n")
}
private static _byTypeConstructor(): Map<ValidatorType, Validator> {