forked from MapComplete/MapComplete
Documentation updates
This commit is contained in:
parent
2d5d3fbd96
commit
e4cd93ffb0
5 changed files with 112 additions and 38 deletions
|
@ -552,7 +552,11 @@ export default class ValidatedTextField {
|
|||
|
||||
public static HelpText(): string {
|
||||
const explanations = ValidatedTextField.tpList.map(type => ["## " + type.name, "", type.explanation].join("\n")).join("\n\n")
|
||||
return "# Available types for text fields\n\nThe listed types here trigger a special input element. Use them in `tagrendering.freeform.type` of your tagrendering to activate them\n\n" + explanations
|
||||
return new Combine([
|
||||
new Title("Available types for text fields", 1),
|
||||
"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").AsMarkdown()
|
||||
}
|
||||
|
||||
private static tp(name: string,
|
||||
|
|
|
@ -31,6 +31,8 @@ import SimpleMetaTagger from "../Logic/SimpleMetaTagger";
|
|||
import MultiApply from "./Popup/MultiApply";
|
||||
import AllKnownLayers from "../Customizations/AllKnownLayers";
|
||||
import ShowDataLayer from "./ShowDataLayer/ShowDataLayer";
|
||||
import Link from "./Base/Link";
|
||||
import List from "./Base/List";
|
||||
|
||||
export interface SpecialVisualization {
|
||||
funcName: string,
|
||||
|
@ -611,7 +613,13 @@ There are also some technicalities in your theme to keep in mind:
|
|||
new Title(viz.funcName, 3),
|
||||
viz.docs,
|
||||
viz.args.length > 0 ? new Table(["name", "default", "description"],
|
||||
viz.args.map(arg => [arg.name, arg.defaultValue ?? "undefined", arg.doc])
|
||||
viz.args.map(arg => {
|
||||
let defaultArg = arg.defaultValue ?? "_undefined_"
|
||||
if(defaultArg == ""){
|
||||
defaultArg = "_empty string_"
|
||||
}
|
||||
return [arg.name, defaultArg, arg.doc];
|
||||
})
|
||||
) : undefined,
|
||||
new Title("Example usage", 4),
|
||||
new FixedUiElement(
|
||||
|
@ -621,13 +629,18 @@ There are also some technicalities in your theme to keep in mind:
|
|||
]
|
||||
));
|
||||
|
||||
|
||||
const toc = new List(
|
||||
SpecialVisualizations.specialVisualizations.map(viz => new Link(viz.funcName, "#"+viz.funcName))
|
||||
)
|
||||
|
||||
return new Combine([
|
||||
new Title("Special tag renderings", 3),
|
||||
"In a tagrendering, some special values are substituted by an advanced UI-element. This allows advanced features and visualizations to be reused by custom themes or even to query third-party API's.",
|
||||
"General usage is `{func_name()}`, `{func_name(arg, someotherarg)}` or `{func_name(args):cssStyle}`. Note that you _do not_fcs need to use quotes around your arguments, the comma is enough to separate them. This also implies you cannot use a comma in your args",
|
||||
"General usage is `{func_name()}`, `{func_name(arg, someotherarg)}` or `{func_name(args):cssStyle}`. Note that you _do not_ need to use quotes around your arguments, the comma is enough to separate them. This also implies you cannot use a comma in your args",
|
||||
toc,
|
||||
...helpTexts
|
||||
]
|
||||
);
|
||||
).SetClass("flex flex-col");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue