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
Provenance
- Commit
2b22874- Tree
a25a635- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
ed1e0d4
4 files changed+11 added−22 removed
modified:docs/extensions.rst+1 added-1 removed
77 unmodified lines78 installed for a French community) may load the translations once and add the79 translation methods to the environment at environment generation time::80 81 translations = get_gettext_translations()82- env = Environment(extensions=['jinja.ext.i18n'])82+ env = Environment(extensions=['jinja2.ext.i18n'])83 env.install_gettext_translations(translations)84 85 The `get_gettext_translations` function would return the translator for the86 current configuration. (For example by using `gettext.find`)141 unmodified linesmodified:docs/integration.rst+2 added-2 removed
19 unmodified lines20 in its Babel extraction method `mapping file`_:21 22 .. sourcecode:: ini23 24- [jinja: **/templates/**.html]24+ [jinja2: **/templates/**.html]25 encoding = utf-826 27 The syntax related options of the :class:`Environment` are also available as28 configuration values in the mapping file. For example to tell the extraction29 that templates use ``%`` as `line_statement_prefix` you can use this code:30 31 .. sourcecode:: ini32 33- [jinja: **/templates/**.html]33+ [jinja2: **/templates/**.html]34 encoding = utf-835 line_statement_prefix = %36 37 :ref:`jinja-extensions` may also be defined by passing a comma separated list51 unmodified linesmodified:docs/switching.rst+5 added-16 removed
68 unmodified lines69 70 Templates71 ~~~~~~~~~72 73-Jinja2 has mostly the same syntax as Jinja1. The only difference is that74-assigning variables doesn't use `set` as keyword now. The following75-example shows a Jinja1 variable assignment::73+Jinja2 has mostly the same syntax as Jinja1. What's different is that74+macros require parentheses around the argument list now.75 77- {% set foo = 42 %}78-79-In Jinja2 the `set` is ommited::80-81- {% foo = 42 %}82-83-Additionally macros require parentheses around the argument list now.84-85-Jinja2 allows dynamic inheritance now and dynamic includes. The old helper86-function `rendertemplate` is gone now, `include` can be used instead.87-Additionally includes no longer import macros and variable assignments, for76+Additionally Jinja2 allows dynamic inheritance now and dynamic includes.77+The old helper function `rendertemplate` is gone now, `include` can be used78+instead. Includes no longer import macros and variable assignments, for79 that the new `import` tag is used. This concept is explained in the80 :ref:`import` documentation.81 91-Currently there is no support for the `recursive` modifier of for loops!82 93-83 Django84 ------85 86 If you have previously worked with Django templates, you should find124 unmodified linesmodified:docs/tricks.rst+3 added-3 removed
1-Tipps and Tricks2-================1+Tips and Tricks2+===============3 4 .. highlight:: html+jinja5 6-This part of the documentation shows some tipps and tricks for Jinja26+This part of the documentation shows some tips and tricks for Jinja27 templates.8 9 10 .. _null-master-fallback:71 unmodified lines