docker-gen icon indicating copy to clipboard operation
docker-gen copied to clipboard

Add ability to use pongo2 as an alternative to Go Template

Open fdintino opened this issue 7 years ago • 2 comments

This is more a proposal than a finished pull request—I wanted to gauge interest and get feedback on the implementation before I started writing tests and updating documentation.

pongo2 is a Go template engine that has a Django/Jinja2-style syntax. My interest in having this available as an option—besides personal preference—is that my development team at The Atlantic is very familiar with the syntax of jinja2, but less so with Go templates. It seems like there might also be others interested in this as well (e.g. #177).

In addition to adding the ability to use pongo2 as the template engine (either with the -engine pongo2 CLI flag or with engine = "pongo2" in a config file) I've ported the existing example templates to pongo2.

I was tempted to make the functions and context variables all lowercase / underscore-separated to make them more idiomatic for Django-style templates, but I thought that might be a bridge too far.

fdintino avatar Oct 01 '17 17:10 fdintino

@jwilder any feedback?

fdintino avatar Oct 19 '17 13:10 fdintino

@fdintino I like it. I need to find some time to test it out, but looks pretty good at first glance.

jwilder avatar Oct 20 '17 16:10 jwilder