patrickdappollonio / tgen

A template tool with no dependencies that works like Helm templates or Consul templates.
MIT License
15 stars 1 forks source link

Would you be willing to add a custom template engine? #9

Open cbmdfc opened 2 years ago

cbmdfc commented 2 years ago

Thank you for this tool!

Would you be willing to consider adding another template engine besides go one? like gobuffalo/plush?

you would be bringing lots of features like function declaration within the language and far more customization

patrickdappollonio commented 2 years ago

Hey! I'm so sorry I didn't answer fast enough here...

I think in order to do this, there would be a few questions to discuss, like:

  1. Do we do this using a flag for the language or we detect it from the file? I think declaratively, it shouldn't be pre-detected because that would break backwards compatibility if, say, you're trying to render a template-to-plush file, so an env var or a flag (like --plush or similar) would work best.

  2. Will plush be enough? This might potentially open the requirement for other template engines to make the cut, and at that point, we would have to veto those. I've heard for example people would want a Jinja or Handlebars (which looks close to Go!) template engine too, but then some of the functions globally available for normal Go templates might not be needed in, say, Plush or Jinja, and at that point it becomes a disparity.

Would love to know more what you think about it though!