Michael Van Canneyt via fpc-pascal
2021-04-20 12:20:34 UTC
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.
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/m
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.
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/m