Skip to content
Myr

Make ease of use update to template documentation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add the phrases 'multiline comment' and 'triple quotes' to docs in the templates/#block-assignments section. This allows for new users to find this alternative easily.

authored by ratchek · committed by David Lord · parent e7cb37d · Browse files · 1 file+4 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−3 removed

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:docs/templates.rst+4 added-3 removed
1088 unmodified lines
1089.. versionadded:: 2.810901091Starting with Jinja 2.8, it's possible to also use block assignments to1092capture the contents of a block into a variable name. This can be useful1093in some situations as an alternative for macros. In that case, instead of1094using an equals sign and a value, you just write the variable name and then1095everything until ``{% endset %}`` is captured.1093in some situations as an alternative for macros. It can also be used to create1094multiline strings instead of triple quotes (''' and """), which Jinja does not1095support. In that case, instead of using an equals sign and a value, you just1096write the variable name and then everything until ``{% endset %}`` is captured.10971098Example::10991100 {% set navigation %}
863 unmodified lines