Skip to content

How to add a code-block depending on a condintion #352

Answered by yajo
incoggnito asked this question in Q&A
Discussion options

You must be logged in to vote

This is because jinja interprets [[. Yo need to escape it:

[[ "[[" ]]tool.poetry.source[[ "]]" ]]

Or you can choose different jinja configuration with envops, such as here, and then change it to:

{% if  special_place %}
    [[tool.poetry.source]]
    name = "foo"
    url = "https://foo/repository/pypi/simple/"
    default = true
{% endif %}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@incoggnito
Comment options

@pawamoy
Comment options

pawamoy Feb 11, 2021
Collaborator

Answer selected by yajo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #351 on February 11, 2021 15:41.