Skip to content

Enable rendering of templates using Jinja2#122

Open
tinloaf wants to merge 1 commit into
quentinsf:masterfrom
tinloaf:jinja
Open

Enable rendering of templates using Jinja2#122
tinloaf wants to merge 1 commit into
quentinsf:masterfrom
tinloaf:jinja

Conversation

@tinloaf
Copy link
Copy Markdown

@tinloaf tinloaf commented Nov 23, 2018

… and I have another one. As for the first:

  • I didn't write documentation for the readme yet. If you like the patch, I'll add it.
  • I noticed too late that I didn't turn off autopep8 in my editor. This PR as it is now includes PEP8-ing your existing code, which isn't a huge change, but mainly some line breaking and whitespace stuff. If you don't like that, I'll remove it again - but I thought maybe you don't have a problem with it, so I don't have to manually change it back. ;-)

Also, this PR has (on its own) merge conflicts with #121 - I have a merged version in case you like both.

This PR adds the possibility to render templates using Jinja2 instead of simple python text formatting, if Jinja2 is installed. Jinja2 gives you way more possibilities than python text formatting… I for example want a comment line above each entry, but only if a "comment" addon is defined (i.e., only if my regexps from #121 found one…). I don't think you can coax python string formatting into printing a ; {something} only if something is defined.

@petdr
Copy link
Copy Markdown
Collaborator

petdr commented Nov 24, 2018

Thanks both look good to me.

If you want to submit a merged pull request. I will merge it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants