Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable rendering of templates using Jinja2 #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tinloaf
Copy link

@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
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.

None yet

2 participants