Template Filler
Fill a Mustache template with data from JSON or CSV, for mail merge, config files or bulk text. Write placeholders such as {{name}}, sections such as {{#items}}...{{/items}} and conditionals, then paste the data. Each row of a CSV or each item of a JSON array produces one filled copy of the template.
Frequently asked questions
Which template syntax is supported?
Mustache: {{name}} for a value, {{user.email}} for nested values, {{#list}}...{{/list}} to repeat over a list or show a block when a value is set, {{^list}}...{{/list}} for the opposite, {{.}} for the current item and {{! comment}} for comments.
How does mail merge with CSV work?
The first row of the CSV holds the column names, and each further row fills the template once. A column called first name is used as {{first name}}. The copies are joined with the separator you choose, such as a blank line or a --- rule.
What JSON can I use?
An object fills the template once. An array of objects fills it once per item, like CSV rows. To render a list inside one template, put it in an object, such as {"items": [...]}, and use a section.
When is a section hidden?
A {{#name}} section is hidden when the value is missing, false, null, 0, an empty string or an empty list. An inverted {{^name}} section is shown in exactly those cases.
Is HTML escaped?
Only if you turn on HTML escaping. Then {{name}} escapes characters such as < and & while {{{name}}} and {{& name}} insert the value unchanged. Without it all values are inserted as they are, which suits plain text and email.
Are partials and lambdas supported?
No. Partials ({{> name}}) produce no output, and lambdas are not possible because the data is JSON or CSV. Everything else of the Mustache syntax works, including changing the delimiters with {{=<% %>=}}.