Skip to content
Myr

some small documentation fixes

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

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent ed1e0d4 · Browse files · 4 files+11 added−22 removed
This commit

State

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

Diff stats

4 files+11 added−22 removed

  • other:+11 added−22 removed

4 files+11 added−22 removed

modified:docs/extensions.rst+1 added-1 removed
77 unmodified lines
78installed for a French community) may load the translations once and add the79translation methods to the environment at environment generation time::8081 translations = get_gettext_translations()82 env = Environment(extensions=['jinja.ext.i18n'])82 env = Environment(extensions=['jinja2.ext.i18n'])83 env.install_gettext_translations(translations)8485The `get_gettext_translations` function would return the translator for the86current configuration. (For example by using `gettext.find`)
141 unmodified lines
modified:docs/integration.rst+2 added-2 removed
19 unmodified lines
20in its Babel extraction method `mapping file`_:2122.. sourcecode:: ini2324 [jinja: **/templates/**.html]24 [jinja2: **/templates/**.html]25 encoding = utf-82627The syntax related options of the :class:`Environment` are also available as28configuration values in the mapping file. For example to tell the extraction29that templates use ``%`` as `line_statement_prefix` you can use this code:3031.. sourcecode:: ini3233 [jinja: **/templates/**.html]33 [jinja2: **/templates/**.html]34 encoding = utf-835 line_statement_prefix = %3637:ref:`jinja-extensions` may also be defined by passing a comma separated list
51 unmodified lines
modified:docs/switching.rst+5 added-16 removed
68 unmodified lines
6970Templates71~~~~~~~~~7273Jinja2 has mostly the same syntax as Jinja1. The only difference is that74assigning variables doesn't use `set` as keyword now. The following75example shows a Jinja1 variable assignment::73Jinja2 has mostly the same syntax as Jinja1. What's different is that74macros require parentheses around the argument list now.7577 {% set foo = 42 %}7879In Jinja2 the `set` is ommited::8081 {% foo = 42 %}8283Additionally macros require parentheses around the argument list now.8485Jinja2 allows dynamic inheritance now and dynamic includes. The old helper86function `rendertemplate` is gone now, `include` can be used instead.87Additionally includes no longer import macros and variable assignments, for76Additionally Jinja2 allows dynamic inheritance now and dynamic includes.77The old helper function `rendertemplate` is gone now, `include` can be used78instead. Includes no longer import macros and variable assignments, for79that the new `import` tag is used. This concept is explained in the80:ref:`import` documentation.8191Currently there is no support for the `recursive` modifier of for loops!829383Django84------8586If you have previously worked with Django templates, you should find
124 unmodified lines
modified:docs/tricks.rst+3 added-3 removed
1Tipps and Tricks2================1Tips and Tricks2===============34.. highlight:: html+jinja56This part of the documentation shows some tipps and tricks for Jinja26This part of the documentation shows some tips and tricks for Jinja27templates.8910.. _null-master-fallback:
71 unmodified lines