Templify Documentation¶
Welcome to Templify - a powerful tool for creating dynamic Word (.docx) and LibreOffice / OpenDocument (.odt) documents from templates with placeholders, conditionals, and loops.
👥 Choose Your Path¶
📝 I Create Word Templates¶
I design Word documents and want to add dynamic placeholders.
I work with Word documents and need to create templates with placeholders like {{CustomerName}} that get filled in with data. I don't need to write code - I just need to know how to structure my templates and data.
→ Get Started as a Template Author
Quick Links:
- JSON Basics - Understanding your data format
- Template Syntax Reference - Complete syntax guide
- Examples Gallery - Real-world templates
- Best Practices - Tips for great templates
- LibreOffice / OpenDocument - Templates written in LibreOffice Writer (.odt, .ott)
💻 I'm a Developer¶
I'm integrating Templify into my .NET application.
I'm a software developer who wants to use the Templify library in my C# application to programmatically generate Word documents from templates.
Quick Links:
- Developer Quick Start - Installation, API overview, options
- OpenDocument (.odt) - OdtTemplateProcessor and the format-detecting TemplateProcessor
- Processing Warnings - Missing variables, loop and expression warnings
- Text Template Processing - Templates for plain text and emails
- Condition Evaluation - Evaluate conditions without a document
- Code Examples - Extensive C# samples (GitHub)
- Architecture Overview - How the library works internally (GitHub)
What is Templify?¶
Templify lets you create Word document templates with special placeholders that get replaced with actual data. Perfect for generating:
- Invoices & Receipts - Customer invoices with line items
- Reports - Formatted reports from database data
- Contracts - Contracts with dynamic clauses
- Letters - Mail merge for personalized letters
- Certificates - Batch-generated certificates
Key Features¶
✨ Simple Placeholders - {{VariableName}} syntax
🔁 Loops - Repeat sections with {{#foreach}}...{{/foreach}}
⚡ Conditionals - Dynamic content with {{#if}}...{{#else}}...{{/if}}
📊 Table Support - Loop through table rows
📄 Word and LibreOffice - .docx templates from Word and .odt/.ott templates from LibreOffice Writer
🎨 Formatting - Preserves Word styling, supports markdown and format specifiers
🚀 No Office Required - Processing needs neither Word nor LibreOffice (template authors still use them to create templates)
Quick Example¶
Template (in Word):¶
Invoice for {{CustomerName}}
Date: {{InvoiceDate}}
Items:
{{#foreach Items}}
- {{Product}}: {{Price}}
{{/foreach}}
Data (JSON):¶
{
"CustomerName": "John Doe",
"InvoiceDate": "2024-01-15",
"Items": [
{ "Product": "Service A", "Price": "$100" },
{ "Product": "Service B", "Price": "$200" }
]
}
Output:¶
Additional Resources¶
❓ FAQ¶
Common questions and troubleshooting tips
🎓 Tutorials¶
Step-by-step guides from the basics to a complete invoice generator
Open Source¶
Templify is open source and licensed under the MIT License.