https://github.com/danieleteti/templatepro
TemplatePro is a powerful and extendable template language for Delphi
https://github.com/danieleteti/templatepro
delphi dmvcframework htmx-template template
Last synced: 6 months ago
JSON representation
TemplatePro is a powerful and extendable template language for Delphi
- Host: GitHub
- URL: https://github.com/danieleteti/templatepro
- Owner: danieleteti
- License: apache-2.0
- Created: 2017-10-09T09:25:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-20T20:11:33.000Z (over 1 year ago)
- Last Synced: 2025-03-20T20:57:03.859Z (over 1 year ago)
- Topics: delphi, dmvcframework, htmx-template, template
- Language: Pascal
- Homepage: https://www.patreon.com/delphimvcframework
- Size: 557 KB
- Stars: 32
- Watchers: 5
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TemplatePro - Template Engine for Delphi

**TemplatePro** is a modern template engine for Delphi and Object Pascal, inspired by Jinja2, Twig, and Smarty. If you're looking for a Jinja-like or Mustache-like template engine for Delphi, TemplatePro is the solution.
[](https://github.com/danieleteti/templatepro)
[](LICENSE)
[](https://www.embarcadero.com/products/delphi)
## What is TemplatePro?
TemplatePro is a template engine library for Embarcadero Delphi and RAD Studio. It allows you to separate presentation logic from business logic by using template files with a clean, readable syntax.
**Use it for:**
- HTML page generation
- Email templates (HTML and plain text)
- Report generation
- Code generation
- Any text-based output
**Supported Delphi versions:** 10 Seattle and later (VCL and FireMonkey).
## Features
- Variables, loops, conditionals
- Filters (built-in and custom)
- Macros for reusable fragments
- Inline expressions
- Template inheritance (multi-level)
- TDataSet support
- Compiled templates for performance
## Quick Start
```pascal
var lCompiler := TTProCompiler.Create;
try
var lTemplate := lCompiler.Compile(
'
{{:title}}
Hello {{:username}}!
');
lTemplate.SetData('title', 'Welcome');
lTemplate.SetData('username', 'Daniele');
ShowMessage(lTemplate.Render);
// Output: Welcome
Hello Daniele!
finally
lCompiler.Free;
end;
```
## Documentation
For complete documentation, examples, and tutorials:
**[https://www.danieleteti.it/templatepro/](https://www.danieleteti.it/templatepro/)**
## License
Apache License 2.0 - See [LICENSE](LICENSE) file.
## Author
**Daniele Teti** - [danieleteti.it](https://www.danieleteti.it)
---
*Keywords: Delphi template engine, Object Pascal templates, Delphi HTML generator, Delphi email templates, RAD Studio template engine*