X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=doc%2FTemplateSyntax.txt;h=f747c2257692a0b2c0e03c53918b44c5d2d6e004;hp=75a42b2b247f5360dc6d8b1d931503af163d9fa2;hb=3238dff5b3beca228359b370bc104f48d6247632;hpb=8fa95a3f5ae14112b2acffdd010c645cd250d61e diff --git a/doc/TemplateSyntax.txt b/doc/TemplateSyntax.txt index 75a42b2b..f747c225 100644 --- a/doc/TemplateSyntax.txt +++ b/doc/TemplateSyntax.txt @@ -1,19 +1,21 @@ 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 -- will insert "some data" into the translated text -- will insert "some data" into the translated text literally (not HTML-escaped) - - ... Output/execute the text until "" only if $variable is Boolean.TRUE (<=> !Boolean.FALSE) or not null. - ... ... @@ -24,4 +26,5 @@ A template is constructed from a charstream. Everything that is not in "