# Text substitution

In read mode, export code expressions that begin with a caret “^” are evaluated and replaced with their result. For example, the expression

> Health: ^value($Health)

would appear as the text

> Health: 10

and the expression

> ...`The hero is ^if($Health>5)fine ^else in trouble^endif.`

would appear as

> ....The hero is fine.

The following export codes may be used:

^value(expression ): evaluates an expression and replaces the placeholder with the corresponding value.

^include( path ): replaces the placeholder with the text of the note specified by path, where path may be the (unique) name of the note, the complete path of a note, or any other designator.

^if( expression ) true-clause ^endif:

^if( expression ) true-clause ^else false-clause ^endif: evaluates the expression. If the result is true, the placeholder is replaced by the text of the true-clause. If false, the placeholder is replaced by the text of the flase-clause.

^stretch(anchor, path, alternate-paths ) : the placeholder will be replaced by the text “anchor”, which will be a link anchor. If that link is clicked, the link text will be replaced by including the text of the note designated by path, provided that note’s $Requirements are met. Additional destinations may be supplied as a list of designators, separated by commas; each destination in turn will be tried until Tinderbox finds one which can be visited. If no destination can be visited, the placeholder will be replaced by the text anchor, but the anchor will not be linked.