On Monday, 11 March 2024 at 14:26:01 UTC, Andrea wrote:
Hi folks,

Working on a side project I have the need to generate text files (mainly D source code) via a templating system. My use case is to have some JSON data populated at runtime from an API and fill-in placeholders in the text with the ability of doing loops over arrays, simple conditions and so on, mostly what https://pkg.go.dev/text/template provides for Go.

Any recommendation on a good library to use ?

I tried https://code.dlang.org/packages/temple but I don't wand to bring in the whole vibe-d dependency ; other projects I found in DUB like `mustache-d`, `jax` or `djinn` seems mostly unmaintained. Opinions ?

Many thanks

You have already mentioned mustache-d. If it compiles with the recent compilers go for it. I used it some time a go for a similar task involving in d code gen.

Reply via email to