File | Date | Author | Commit |
---|---|---|---|
_doc | 2021-09-23 | Anthon van der Neut | [fa304f] badges, example link |
_test | 2017-06-14 | Anthon van der Neut | [ff63c0] initial plugin |
.hgignore | 2019-06-08 | Anthon van der Neut | [018fbd] cleanup |
.hgtags | 2021-09-23 | Anthon van der Neut | [c6b216] Added tag 0.2.7 for changeset fa304f6b72da |
LICENSE | 2021-09-23 | Anthon van der Neut | [487ec2] support jinja2 if-statement |
README.rst | 2021-09-23 | Anthon van der Neut | [fa304f] badges, example link |
__init__.py | 2021-09-23 | Anthon van der Neut | [fa304f] badges, example link |
__plug_in__.py | 2021-09-23 | Anthon van der Neut | [487ec2] support jinja2 if-statement |
setup.py | 2021-09-23 | Anthon van der Neut | [487ec2] support jinja2 if-statement |
tox.ini | 2021-09-23 | Anthon van der Neut | [487ec2] support jinja2 if-statement |
version: | 0.2.7 |
---|---|
updated: | 2021-09-23 |
repository: | https://sourceforge.net/projects/ruamel-yaml-jinja2/ |
pypi: | https://pypi.org/project/ruamel.yaml.jinja2/ |
jinja2 templates for YAML files can normally not be loaded as YAML before rendering the template. This plugin allows pre and post-processing based on the round-trip processor.
It works by rewriting the jinja2 constructs and keeping track of what needs to be "un-rewritten" for this to work, you need to use the same YAML() instance for loading and dumping.
Its intended use is allowing you to update hardcoded values in the YAML file, and not to update the jinja2 template part (which might even only be available in a comment).
See, the bottom of, this StackOverflow answer or this one.