# Syntax URL: /docs/syntax/ Section: syntax Tags: syntax, templates -------------------------------------------------------------------------------- Syntax Kida's template syntax for expressions, control flow, and composition. Quick Reference Element Syntax Example Output {{ expr }} {{ user.name }} Tags {% tag %} {% if %}, {% for %} Block end {% end %} Unified ending Comments {# text #} {# TODO #} Filters | filter {{ name \| upper }} Pipeline |> filter {{ x \|> a \|> b }} Syntax Guide Variables Output expressions and access patterns {{ name }}, {{ user.email }}, {{ items[0] }} Git Branch Control Flow Conditionals, loops, and pattern matching {% if %}, {% for %}, {% match %} Filter Filters Transform values in expressions {{ name | upper }}, {{ items | join(', ') }} Function Functions Define reusable template functions {% def greet(name) %}, {% macro %} Inheritance Extend and override base templates {% extends %}, {% block %} Includes Include partials and components {% include %}, context passing Database Caching Block-level output caching {% cache key %}...{% end %} Async Async iteration and await async for, await, async templates Key Features Unified {% end %} — Clean, consistent block endings Pattern matching — {% match status %}{% case "active" %}...{% end %} Pipeline operator — {{ title |> escape |> upper |> truncate(50) }} Built-in caching — {% cache "sidebar" %}...{% end %} -------------------------------------------------------------------------------- Metadata: - Word Count: 216 - Reading Time: 1 minutes