git.iko.soy/typeable/pandoc
on master help sign in
MANUAL: clarify truthiness in template variables (#4631)

closes #2281

commiteb3521e4c9ae044f170433d4e30570a0d0578e20 authorMauro Bieg <mb21@users.noreply.github.com> dateTue 8 May 2018, 18:36 (8 years ago) parent44f1c72
1 file changed+18−4
MANUAL.txt+18−4
MANUAL.txt+18−4
@@ -1701,10 +1701,24 @@ Templates may contain conditionals. The syntax is as follows:
17011701 Y
17021702 $endif$
17031703
1704−This will include `X` in the template if `variable` has a non-null
1705−value; otherwise it will include `Y`. `X` and `Y` are placeholders for
1706−any valid template text, and may include interpolated variables or other
1707−conditionals. The `$else$` section may be omitted.
1704+This will include `X` in the template if `variable` has a truthy
1705+value; otherwise it will include `Y`. Here a truthy value is any
1706+of the following:
1707+
1708+- a string that is not entirely white space,
1709+- a non-empty array where the first value is truthy,
1710+- any number (including zero),
1711+- any object,
1712+- the boolean `true` (to specify the boolean `true`
1713+ value using YAML metadata or the `--metadata` flag,
1714+ use `y`, `Y`, `yes`, `Yes`, `YES`, `true`, `True`,
1715+ `TRUE`, `on`, `On`, or `ON`; with the `--variable`
1716+ flag, simply omit a value for the variable, e.g.
1717+ `--variable draft`).
1718+
1719+`X` and `Y` are placeholders for any valid template text,
1720+and may include interpolated variables or other conditionals.
1721+The `$else$` section may be omitted.
17081722
17091723When variables can have multiple values (for example, `author` in
17101724a multi-author document), you can use the `$for$` keyword: