Package-level declarations

Functions

Link copied to clipboard
.foreach iterable:{Iterable<Any>} body:{Lambda} -> Iterable<Any>

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.

Link copied to clipboard
.function name:{String} body:{Lambda} -> Void

Defines a custom function that can be called later in the document. The amount of parameters (thus of expected arguments) is determined by the amount of explicit lambda parameters. Arguments can be accessed as a function call via their names. The return type of the function is dynamic, hence it can be used as an input of various types for other function calls.

Link copied to clipboard
.if condition:{Boolean} body:{Lambda} -> Any
Link copied to clipboard
.ifnot condition:{Boolean} body:{Lambda} -> Any
Link copied to clipboard
.let value:{Dynamic} body:{Lambda} -> Any

Defines a temporary variable that can be used in the lambda body. Example:

Link copied to clipboard
.node -> Node

Creates a null invisible node that forces the expression it lies in to be evaluated as Markdown content. This is a workaround that can be used at the beginning of lambda blocks (e.g. in a .function, .if or .foreach call) in case the visible output does not match the expected one.

Link copied to clipboard
.repeat times:{Int} body:{Lambda} -> Iterable<Any>

Repeats content N times. The current index (starting from 1) can be accessed via the lambda argument. This is shorthand for foreach {..N} {body}.

Link copied to clipboard
.var name:{String} value:{Dynamic} -> Void

Defines a new variable or overwrites an existing one. Variables can be referenced just like functions, via .variablename.