Text Template Workbench
Write a template and supply a JSON object to generate a document. The supported subset includes {{name}} variables, {{#items}} loops or conditions, {{^items}} empty-case branches, {{.}} for the current item, and dotted child keys. Missing paths and the actual branch or iteration trace help you review the generated document. This is a limited Mustache-inspired subset, not a complete Mustache 1.3 implementation.
Key features
- Variable substitution with dotted JSON keys and parent-context lookup
- Nested array loops and true/false or empty-list sections
- Default HTML character escaping or an explicit plain-text value mode
- Missing-path and object-as-text findings with executed branch positions
- Download rendered TXT and a trace JSON that omits your original inputs
How to use
- Write a template or load the order example.
- Enter a JSON object matching its variable names.
- Choose HTML escaping and optional strict handling of missing paths.
- Render and review the output, missing values and section/iteration trace.
- Download the TXT document or JSON trace if needed.
Use cases
- Create an order notice from itemized order data
- Generate a summary for each person in a supplied list
- Show different wording for empty and nonempty lists
Frequently asked questions
Is this fully compatible with Mustache templates?
No. It is a Mustache-inspired subset covering variables, dotted names, arrays and conditional/inverted sections and comments. Partials, lambdas, delimiter changes, unescaped tags and standalone-line whitespace rules are unsupported.
Can template JavaScript run?
No. JSON.parse reads data, and a small tokenizer interprets the template. It does not execute code, fetch files or URLs, or send input to a server. Output is shown as text, never rendered as HTML on this page.
What happens with a missing variable or an object used as text?
By default a missing path becomes an empty string and is reported with its position and count. Strict mode refuses output if any path is missing. An object or array interpolated as a value becomes empty text and a separate finding; use a child key or a section instead.
What is the difference between HTML escape and plain mode?
The default turns &, <, > and quotes in variable values into HTML entities. Plain mode leaves variable characters unchanged. Neither mode executes or renders HTML here; review the context of any other application where you paste the result.
What limits and storage apply?
The template is limited to 24 KB, JSON to 64 KB, output to 120,000 characters and total array iterations to 600, among other bounds. There is no autosave; only files you deliberately download remain on your device.
Privacy
Templates and JSON are processed only in browser memory; they are neither uploaded nor saved automatically. Document and trace files are created locally only when you download them. Protect downloaded files if your data is sensitive.
Comments & questions