Syntax

Urtext dynamically generates output from its own text content using “dynamic outputs”. Instructions for dynamic outputs are written inside the dynamic definition wrapper syntax, double square brackets:

[[ and ]]

Text inside these wrappers has a special “scope”, meaning it is interpreted differently from other Urtext syntax. Dynamic definitions may contain any number of directives.

Definitions can be written anywhere; it is not necessary to store a definition in the same file to which it refers.

Directives

Directives are capitalized, non-whitespace names followed immediately by opening and closing parentheses which may enclose one or more parameters. A minimal dynamic definition includes a TARGET() directive for the output and another directive to specific the output. The target can be a node, file or virtual target.

[[
TARGET(| Some output Node >)
INCLUDE(*)
]]

The link wrapper syntax inside the TARGET() directive is not required but makes the parameter more readable and also provides a working link to the output node.

There are no restrictions on spacing, indentation, newlines, or other arbitrary text or whitespace. The order of parameters within a definition is unimportant; they are evaluated as a group and applied in an order determined by the directives themselves. (Developer documentation on this topic is forthcoming.)

Making a dynamic definition does not create the target node.  The target node must exist in the project. It may be in the same file or in any other file in the project.

In Sublime Urtext, a snippet is provided to automate creating and titling a new node and populating its dynamic definition in one step. To invoke it, type dynamic and press tab. Type the name of the new node, then tab between entry points in the definition template. Delete whatever portions you do not need.

Included Directives

Several basic directives are included in Urtext. Their use and syntax are described on the Directives page.

Writing Your Own Directives

A mechanism for writing new directives is part of Urtext. Documentation for this is forthcoming.