# Package-level declarations

## Functions

extend
Link copied to clipboard

    .extend name:{String} \
           where:{Lambda? = null} \
            body:{Lambda}
    -> Void

Content copied to clipboard

Defines a custom function that extends an existing one by name, wrapping its output.

foreach
Link copied to clipboard

    .foreach iterable:{Iterable<Any>} body:{Lambda} -> Iterable<Any>

Content copied to clipboard

Repeats content for each element of an iterable collection. The current element can be accessed via the lambda argument, which may be either explicit or implicit.

function
Link copied to clipboard

    .function name:{String} body:{Lambda} -> Void

Content copied to clipboard

Defines a custom function that can be called later in the document.

if
Link copied to clipboard

    .if condition:{Boolean?} body:{Lambda} -> Any

Content copied to clipboard

Performs a conditional evaluation of content, including the evaluation of body only if the condition is met. The expression is not evaluated if the condition is false.

ifnot
Link copied to clipboard

    .ifnot condition:{Boolean?} body:{Lambda} -> Any

Content copied to clipboard

Shorthand for `.if {.condition::not}`.

let
Link copied to clipboard

    .let value:{Dynamic} body:{Lambda} -> Any

Content copied to clipboard

Defines a temporary variable that lives only inside the lambda body.

node
Link copied to clipboard

    .node -> Node

Content copied to clipboard

Creates a null invisible node that forces the expression it lies in to be evaluated as Markdown content.

repeat
Link copied to clipboard

    .repeat times:{Int} body:{Lambda} -> Iterable<Any>

Content copied to clipboard

Repeats content `N` times. This is shorthand for `.foreach {..N}`.

var
Link copied to clipboard

    .var name:{String} value:{Dynamic} -> Void

Content copied to clipboard

Defines a new variable or overwrites an existing one.