Display and control-flow macros handle everything from printing expressions to branching story logic, iterating over collections, scheduling delayed output, and navigating between passages. This page covers all of them in one place.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pompom454/tea/llms.txt
Use this file to discover all available pages before exploring further.
Output macros
<<print expression>>
Outputs a string representation of the evaluated expression. Markup in the result is processed normally.
<<= expression>>
Alias for <<print>>. Outputs the result of the expression with markup processing.
<<- expression>>
Like <<print>> but also HTML-encodes the output, making it safe to print user-supplied or untrusted strings without injecting markup.
<<include passageName [elementName]>>
Outputs the contents of another passage in-place, optionally wrapping it in an HTML element. Can be called with a plain passage name string or with link markup.
The name of the passage to include. May also be written as link markup
[[Passage Name]] (regular form only, no setters).Optional HTML element tag to wrap the included passage in. The element receives a class derived from the passage name.
<<nobr>> … <</nobr>>
Strips all leading and trailing newlines from the block’s output, then replaces any remaining internal newline sequences with single spaces. Useful for keeping multi-line macro blocks from introducing unwanted blank lines.
<<silent>> … <</silent>>
Executes its contents but discards all output (errors are still shown). Useful for setting up timed loops or other side-effectful code that should produce no visible text.
<<type speed [options]>> … <</type>>
Outputs its contents one code point at a time, simulating a teletype or typewriter effect. Can type links, markup, and other macros.
Rate at which characters are typed. Valid CSS time values:
40ms, 1s, etc. 0s/0ms causes immediate completion. Values of 20–60ms are a good starting range.Optional. Delay before typing begins. Defaults to
400ms.Optional. Space-separated class names added to the typing container.
Optional. HTML element used as the typing container. Defaults to
div.Optional. Unique ID assigned to the typing container.
Optional. Keeps the cursor visible after typing completes.
Optional. Suppresses the cursor entirely.
Optional. Key name that causes typing to complete immediately. Defaults to
Config.macros.typeSkipKey.<<do [tag tags] [element tag]>> … <</do>> and <<redo [tags]>>
<<do>> renders its contents and re-renders them whenever a matching <<redo>> command is received. Use it to create reactive display regions that update in response to state changes.
Optional. Space-separated tag names. When
<<redo>> is called with matching tags, only tagged <<do>> blocks respond.Optional. HTML element used as the content container. Defaults to
span.<<if conditional>> … [<<elseif>>] … [<<else>>] … <</if>>
Executes the first branch whose condition evaluates to true. Supports any number of <<elseif>> clauses and an optional final <<else>>.
<<for>> … <</for>>, <<break>>, <<continue>>
Repeatedly executes its body. Three forms are available:
Conditional-only form
Conditional-only form
3-part conditional form
3-part conditional form
Range form — array
Range form — array
Range form — integer
Range form — integer
<<break>> to exit the loop immediately, or <<continue>> to skip to the next iteration:
The range form supports arrays, sets, maps, generic objects, integers, and strings. Loop variables are perfect candidates for temporary
_variables (e.g. _i, _name). The maximum iterations for conditional forms is configurable via Config.macros.maxLoopIterations.<<switch expression>> … <</switch>>
Evaluates an expression and executes the first <<case>> whose value list contains a match. An optional <<default>> case runs when no cases match; it must be last.
<<goto passageName>>
Immediately forwards the player to the named passage. Accepts a plain name or link markup.
<<repeat delay [transition|t8n]>> … <</repeat>> and <<stop>>
Repeatedly executes its body after the specified delay, reinserting the output each time. Use <<stop>> inside the body to halt the repetition.
How long to wait between executions. Minimum
40ms. Accepts CSS time values: 1s, 500ms, etc.Optional. Applies a CSS transition to each new insertion.
<<timed delay [transition|t8n]>> … [<<next [delay]>>] … <</timed>>
Executes its body once after the specified delay. Additional <<next>> child blocks may be chained to create sequenced timed events.
Delay before the first execution. Minimum
40ms.Optional. Delay for this
<<next>> step. If omitted, reuses the previous delay.