Awee

Sintax

A fast, dependency-aware template engine with a composable modifier pipeline.

Transform any value with a single expression. Chain modifiers, resolve variable dependencies automatically, and handle complex data structures - without writing transformation logic by hand.

{{ response | from:'json' | key:'items' | filter:'status','active' | first | key:'name' | default:'unknown' }}

The pipe syntax

Values flow left to right through a chain of modifiers. Each modifier takes the output of the previous step as its input:

{{ title | trim | lower | slug }}
→ "my-post-title"

{{ body | shorten:160 }}
→ "First 160 characters of the body..."

{{ csv_line | split:',' | join:' | ' }}
→ "value1 | value2 | value3"
{{ users | filter:'active',true | sort:'name' | first | key:'email' }}
→ "alice@example.com"

{{ tags | has:'featured' ? 'highlighted' : 'standard' }}
→ "highlighted"

{{ products | map:'sku' }}
→ { "SKU-001": {...}, "SKU-002": {...} }
{{ file_path | dirname }}
→ "/usr/local/share"

{{ file_path | filename | ext-trim }}
→ "config"

{{ asset | ext-prepend:'min' }}
→ "app.min.js"
{{ now | format:'YYYY-MM-DD' }}
→ "2026-04-16"

{{ now | format:'D, d M Y' }}
→ "Thursday, 16 Apr 2026"

{{ created_at | format:'H:i' }}
→ "14:30"

Variables that reference each other

Unlike most template engines, sintax doesn't require a pre-resolved context. Define your variables in any order - sintax works out the dependencies and resolves them correctly.

env:      "production"
prefix:   "{{ env | upper }}"
db_url:   "{{ prefix }}_database"
label:    "Connected to {{ db_url }}"
label → "Connected to PRODUCTION_database"

Circular references are detected before resolution starts and reported as a clear error.


Safe fallbacks

The default modifier short-circuits an entire pipeline when a value is missing, making it easy to build expressions that degrade gracefully:

{{ config | from:'json' | key:'timeout' | default:30 }}
{{ user | key:'profile.avatar' | default:'https://example.com/default.png' }}
{{ tags | filter:'featured' | first | default:'general' }}

default catches both missing variables and modifier errors - so a broken upstream value won't crash the whole expression.


Conditional output

{{ if is_admin }}Full access{{ else }}Limited access{{ /if }}

{{ count | gt:0 ? count : 'none' }}

The eq, gt, gte, and not modifiers return booleans you can use directly in conditions or ternary expressions.


Modifier categories

How is this guide?

On this page