11Templates
22=========
33
4- Flask leverages Jinja2 as its template engine. You are obviously free to use
5- a different template engine, but you still have to install Jinja2 to run
4+ Flask leverages Jinja as its template engine. You are obviously free to use
5+ a different template engine, but you still have to install Jinja to run
66Flask itself. This requirement is necessary to enable rich extensions.
7- An extension can depend on Jinja2 being present.
7+ An extension can depend on Jinja being present.
88
9- This section only gives a very quick introduction into how Jinja2
9+ This section only gives a very quick introduction into how Jinja
1010is integrated into Flask. If you want information on the template
11- engine's syntax itself, head over to the official `Jinja2 Template
11+ engine's syntax itself, head over to the official `Jinja Template
1212Documentation <https://jinja.palletsprojects.com/templates/> `_ for
1313more information.
1414
1515Jinja Setup
1616-----------
1717
18- Unless customized, Jinja2 is configured by Flask as follows:
18+ Unless customized, Jinja is configured by Flask as follows:
1919
2020- autoescaping is enabled for all templates ending in ``.html ``,
2121 ``.htm ``, ``.xml ``, ``.xhtml ``, as well as ``.svg `` when using
@@ -25,13 +25,13 @@ Unless customized, Jinja2 is configured by Flask as follows:
2525- a template has the ability to opt in/out autoescaping with the
2626 ``{% autoescape %} `` tag.
2727- Flask inserts a couple of global functions and helpers into the
28- Jinja2 context, additionally to the values that are present by
28+ Jinja context, additionally to the values that are present by
2929 default.
3030
3131Standard Context
3232----------------
3333
34- The following global variables are available within Jinja2 templates
34+ The following global variables are available within Jinja templates
3535by default:
3636
3737.. data :: config
@@ -140,7 +140,7 @@ using in this block.
140140Registering Filters
141141-------------------
142142
143- If you want to register your own filters in Jinja2 you have two ways to do
143+ If you want to register your own filters in Jinja you have two ways to do
144144that. You can either put them by hand into the
145145:attr: `~flask.Flask.jinja_env ` of the application or use the
146146:meth: `~flask.Flask.template_filter ` decorator.
@@ -157,7 +157,7 @@ The two following examples work the same and both reverse an object::
157157
158158In case of the decorator the argument is optional if you want to use the
159159function name as name of the filter. Once registered, you can use the filter
160- in your templates in the same way as Jinja2 's builtin filters, for example if
160+ in your templates in the same way as Jinja 's builtin filters, for example if
161161you have a Python list in context called `mylist `::
162162
163163 {% for x in mylist | reverse %}
@@ -211,7 +211,7 @@ strings. This can be used for streaming HTML in chunks to speed up
211211initial page load, or to save memory when rendering a very large
212212template.
213213
214- The Jinja2 template engine supports rendering a template piece
214+ The Jinja template engine supports rendering a template piece
215215by piece, returning an iterator of strings. Flask provides the
216216:func: `~flask.stream_template ` and :func: `~flask.stream_template_string `
217217functions to make this easier to use.
0 commit comments