jinja2-cli
jinja2-cli copied to clipboard
Add -i/--includes option extending template search path
This is useful for reuse when a set of shared templates are maintained in another directory by using {% include 'lib/header.j2' %} style includes.
Closes #75
Hey, this is great! Lemme take a closer look at this.
I also have a use for this! Any reason why this is not getting merged? 🤔
TBH I forgot about this. Should I merge it?
Reopen after implementing feedback from @mykhailo-inv-disco
@georgespalding Please take a look at this PR: https://github.com/videoplaza/jinja2-cli/pull/3 . I've added some tests with and without --includes flag. I've got too many templates 🤕 )
@mattrobenolt Anything else you'd like fixed before merging?
btw, if you need --includes flag set to templates root but cannot wait for the new version of the jinja2-cli package to be released, as a temporary workaround, you can copy a template into the template root just before rendering it (also don't forget to remove it afterwards), and now you can have predictable imports inside templates.
thanks for the workaround.
Would be really great to get this merged :( This version is packaged in most of the distros ....
+1, I just ran into this issue and currently exploring available options.
@mattrobenolt , I noticed the latest release was done over 2 years ago. Is there anything we can do here?