X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=doc%2FTemplateSyntax.txt;h=ad8e09ae170f0e9f82326af1f60b06199f37f890;hp=9309f5e21808521681eeed194a838296af6449ac;hb=0a72fb51898c89d155f959dc8fb15c52e017a731;hpb=39dc98588cb64182e9f600dfb088cf71c69a127f diff --git a/doc/TemplateSyntax.txt b/doc/TemplateSyntax.txt index 9309f5e2..ad8e09ae 100644 --- a/doc/TemplateSyntax.txt +++ b/doc/TemplateSyntax.txt @@ -1,21 +1,26 @@ A template is constructed from a charstream. Everything that is not in "" will be outputted directly. Text in these markers will be interpreted is template scripting syntax. The following strings are valid: -- will output "variablename". +General remarks: +- $variablename: a variablename matches the regex [a-zA-Z0-9_-] +Syntax: +- will output "variablename". if "variablename" is an Outputable output this thing recursively. else turn it into a String (Object.toString()) and output it. + +- will output the variable "variablename" but not HTML-escaped - will translate "This is free Text." into the users language, (escaped) and output it. - -- - Translate the last string. Output $var1,...,$varn replaced into the %s positions in the translated string. + Text may not contain "?>". + If the text contains "$" or "!'" it is interpreted as "advanced replacement". + - ${variablename} is interpreted as "output this variable at this point" + - !'literal content' output "literal content" here and do not translate or escape. (literal content may not contain any of: {}'$ ) + Then the whole text than also may not contain "{" and "}". -- will output the variable "variablename" but not HTML-escaped -- will insert the variable "variablename" into the translated text but not HTML-escaped - -- - Output/execute the text until "" only if $variable not null or Boolean.FALSE. - -- +- ... + Output/execute the text until "" only if $variable is Boolean.TRUE (<=> !Boolean.FALSE) or not null. +- ... ... + +- ... If $variable is an "IterableDataset" Output/execute the text until "" repeated as $variable suggests. Special variables that $variable defines can be used in the inner text.