aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md
index c0deebb..03bef80 100644
--- a/README.md
+++ b/README.md
@@ -96,6 +96,34 @@ Adds a varlist that should be used one iteration through the loop
Turns a template and varlist into a string. the returned char\* should NOT be freed. The returned char\* is only valid until TMPL\_render() is called again. If you need it even after TMPL\_render() is called, copy it. The length of the returned string is put into `length` to help in copying.
+### Templating tags
+
+ <TMPL_VAR name="variable_name" default="default_value">
+
+Substitutes a variable, with an optional default value.
+
+Prints the variable named "variable\_name" in it's place, if no variable named "variable\_name" is found, the default printed. If there is not variable name, and no default value, an error is logged, and it is expanded to an empty string. (If you need to have nothing printed when the variable does not exist, you should use `default=""` to keep the error log clean.
+
+ <TMPL_IF name="variable_name" value="check_value">
+ :
+ <TMPL_ELSEIF name="variable_name" value="check_value">
+ :
+ <TMPL_ELSE>
+ :
+ <TMPL_END>
+
+Branching statements, checks if a variable is equal to a constant value.
+
+Checks if the variable "variable\_name" contains the string "check\_value". There is currently no way to check if two variables are equal. Elseif and Else clauses are optional. All `TMPL_IF` statements must be closed with `TMPL_END`.
+
+ <TMPL_LOOP name="loop_name">
+ :
+ <TMPL_END>
+
+Loop statements, I bet you can't figure out what this does.
+
+Loops through a loop named "loop\_name", each iteration through the loop, only the varlist added to the loop is visible. That is, no other varlist, even the parent varlist, is visible while inside the loop.
+
<section id="Examples"></section>
## Examples