-
Notifications
You must be signed in to change notification settings - Fork 0
Functions
Leonard Ramminger edited this page May 14, 2026
·
1 revision
{{ fn greet(name) }}Hello {{ name }}{{ endfn }}
{{ greet("Ada") }}Behavior:
- definition emits no output
- return value is rendered text string
- available only after definition point
{{ fn users() lua:block }}
return { { name = "Ada" }, { name = "Grace" } }
{{ endfn }}Behavior:
- return type can be scalar, list, object, bool, number, or null
- usable in
if,set, interpolation, andfor
- function defined in file is visible from that point onward
- later includes from that point can use it
- function defined inside include stays local to that include
- call before definition fails
- wrong arity fails
- unknown function fails
- native template function cannot act as iterable for
for