Skip to content

Commit

Permalink
Some fixes in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
uwefladrich committed Nov 5, 2024
1 parent 95a3383 commit 5cfc400
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/sphinx/scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,20 @@ Other filters

render
Renders the expression (e.g. a variable) with Jinja2 and the current context. This can be used, for
example, to explicitly render context parameters that have been set with the `!noparse` tag::
example, to explicitly render context parameters that have been set with the ``!noparse`` tag::

- base.context:
foo: me
bar: !noparse "{{ foo }}"
- when "{{ bar|render == 'me' }}"
- when: "{{ bar|render == 'me' }}"
base.echo:
msg: "It is {{ bar }}!"

Without using the `render` filter in the example, the `when` clause would evaluate to `false` because
the value of `bar` would still be `"{{ foo }}"` because of `!noparse`.
Without using the ``render`` filter in the example, the ``when`` clause would evaluate to ``false``
because the value of ``bar`` would still be ``"{{ foo }}"`` as a consequence of ``!noparse``.

.. versionadded:: 1.1
``render`` filter added.


.. _PyYAML: https://pyyaml.org
Expand Down

0 comments on commit 5cfc400

Please sign in to comment.