aboutsummaryrefslogtreecommitdiff
path: root/MANUAL.txt
diff options
context:
space:
mode:
authorMauro Bieg <mb21@users.noreply.github.com>2018-05-08 18:36:50 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2018-05-08 09:36:50 -0700
commiteb3521e4c9ae044f170433d4e30570a0d0578e20 (patch)
tree7b9963a94a191febd3eb0e33bd1b0bbac77dfe98 /MANUAL.txt
parent44f1c72b28b41a20f6864b38bf575fd1f1624ad4 (diff)
downloadpandoc-eb3521e4c9ae044f170433d4e30570a0d0578e20.tar.gz
MANUAL: clarify truthiness in template variables (#4631)
closes #2281
Diffstat (limited to 'MANUAL.txt')
-rw-r--r--MANUAL.txt22
1 files changed, 18 insertions, 4 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index e2bb76cae..42b658af9 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1701,10 +1701,24 @@ Templates may contain conditionals. The syntax is as follows:
Y
$endif$
-This will include `X` in the template if `variable` has a non-null
-value; otherwise it will include `Y`. `X` and `Y` are placeholders for
-any valid template text, and may include interpolated variables or other
-conditionals. The `$else$` section may be omitted.
+This will include `X` in the template if `variable` has a truthy
+value; otherwise it will include `Y`. Here a truthy value is any
+of the following:
+
+- a string that is not entirely white space,
+- a non-empty array where the first value is truthy,
+- any number (including zero),
+- any object,
+- the boolean `true` (to specify the boolean `true`
+ value using YAML metadata or the `--metadata` flag,
+ use `y`, `Y`, `yes`, `Yes`, `YES`, `true`, `True`,
+ `TRUE`, `on`, `On`, or `ON`; with the `--variable`
+ flag, simply omit a value for the variable, e.g.
+ `--variable draft`).
+
+`X` and `Y` are placeholders for any valid template text,
+and may include interpolated variables or other conditionals.
+The `$else$` section may be omitted.
When variables can have multiple values (for example, `author` in
a multi-author document), you can use the `$for$` keyword: