Skip to content

support jinja templates in needs-role-need-template#1698

Open
PhilipPartsch wants to merge 2 commits intouseblocks:masterfrom
PhilipPartsch:jinja_for_needs-role-need-template
Open

support jinja templates in needs-role-need-template#1698
PhilipPartsch wants to merge 2 commits intouseblocks:masterfrom
PhilipPartsch:jinja_for_needs-role-need-template

Conversation

@PhilipPartsch
Copy link
Copy Markdown
Contributor

Implementation of #1697 1697

if ref_name and prefix in ref_name and postfix in ref_name:
# if ref_name is set and has prefix to process, we will do so.
ref_name = ref_name.replace(prefix, "{").replace(postfix, "}")
# Keep the user-facing [[...]] syntax, but render using Jinja.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you should be able to do this in a more "proper" way, using this API.

import minijinja

env = minijinja.Environment()
env.variable_start_string = "[["
env.variable_end_string = "]]"

Maybe you could add a way to apply this via the compile_template function

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