Enable rendering of templates using Jinja2#122
Open
tinloaf wants to merge 1 commit into
Open
Conversation
Collaborator
|
Thanks both look good to me. If you want to submit a merged pull request. I will merge it in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… and I have another one. As for the first:
autopep8in 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 ifsomethingis defined.