Sign in Join

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

Mailing lists / lazarus / 2021-04

Mustache templates implementation

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello ,

For my job I needed a Mustache templates library in pascal.

Since dmustache (part of mORMot) fails the official mustache tests and did not work on the platform I needed it for, I wrote my own implementation.

The result has been committed to packages/fcl-mustache, in case someone else has a need for it.

Basic Features:
- TMustache Component, can be dropped on a form.
- Compiles the template, so repeated output should be fast.
- Passes all official testcases (including weird whitespace rules).
- JSON data input by default.
- Output easily configurable.

Extra:
- Integration with FPExprPars engine for expressions: {{[age + 2]}} will work.
- You can use datasets as source of data.
- Written to be easily extendable with other features.
- Unit tested.

Demos available, there is a complete usable command-line program that has all features enabled.

Enjoy,

Michael.

Reply by email