Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

templatepro

TemplatePro is a powerful and extendable template language for Delphi (mirror)

View on Codeberg

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

TemplatePro - Template Engine for Delphi

TemplatePro Logo

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.

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(
    '<h1>{{:title}}</h1><p>Hello {{:username}}!</p>');
  lTemplate.SetData('title', 'Welcome');
  lTemplate.SetData('username', 'Daniele');
  ShowMessage(lTemplate.Render);
  // Output: <h1>Welcome</h1><p>Hello Daniele!</p>
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 file.

Author

Daniele Teti - danieleteti.it


Keywords: Delphi template engine, Object Pascal templates, Delphi HTML generator, Delphi email templates, RAD Studio template engine