prepend('$') → $1,234.50 Conditional Logic % if order.status == 'shipped' % <div class="success">Your order is on the way.</div> % elif order.status == 'pending' % <div class="warning">Processing...</div> % else % <div class="error">Contact support.</div> % endif % Loops (Iteration) Loop through arrays to build tables dynamically:
| Filter | Input | Output | |--------|-------|--------| | upper | name → "john" | "JOHN" | | capitalize | city → "paris" | "Paris" | | default('N/A') | middle_name (null) | "N/A" | | number_format(2) | 1234.5 | "1,234.50" | Afratafreeh Doc Tutorial-
% include "header.afd" % <main>Dynamic content here...</main> % include "footer.afd" % 4.1. Batch Document Generation Generate 1000 custom invoices from a CSV: prepend('$') → $1,234
afratafreeh multi-render -t receipt.afd -d order_123.json -f pdf,html Embed SQL directly in the template (if using the Pro connector): prepend('$') → $1
Use the --debug flag to print the abstract syntax tree (AST) before rendering.
"user": "name": "Alex Johnson" Run the command: