Re: [fpc-pascal] Mustache templates implementation

2021-04-23 Thread Michael Van Canneyt via fpc-pascal



On Wed, 21 Apr 2021, Michael Van Canneyt via fpc-pascal wrote:




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


Now thank you for this, I'll be sure to check it out to replace dmustache.


I'm currently porting it to Delphi (where I'll eventually need it) and will
publish those sources too on gitlab or so.
Delphi's JSON handling is not compatible to FPC's so some minor changes are 
needed.


For those interested, I published the Delphi code at:
https://gitlab.com/mvancanneyt/mustached

Michael.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Mustache templates implementation

2021-04-21 Thread Michael Van Canneyt via fpc-pascal



On Tue, 20 Apr 2021, leledumbo via fpc-pascal wrote:


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.


I do remember it didn't pass all the tests, but still works for my needs so
I let it be.


My biggest beef is that it does not work on all platforms, because it pulls
in some of mORMot. My implementation just needs the classes and sysutils
units..




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


Now thank you for this, I'll be sure to check it out to replace dmustache.


I'm currently porting it to Delphi (where I'll eventually need it) and will
publish those sources too on gitlab or so.
Delphi's JSON handling is not compatible to FPC's so some minor changes are 
needed.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Mustache templates implementation

2021-04-20 Thread leledumbo via fpc-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.

I do remember it didn't pass all the tests, but still works for my needs so
I let it be.

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

Now thank you for this, I'll be sure to check it out to replace dmustache.



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Mustache templates implementation

2021-04-20 Thread Michael Van Canneyt via fpc-pascal


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-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal