From 2b22874121841372156308242def53116795199c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 18 May 2008 20:29:32 +0200 Subject: [PATCH] some small documentation fixes --HG-- branch : trunk --- docs/extensions.rst | 2 +- docs/integration.rst | 4 ++-- docs/switching.rst | 21 +++++---------------- docs/tricks.rst | 6 +++--- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/docs/extensions.rst b/docs/extensions.rst index 9d9bea0..65f0082 100644 --- a/docs/extensions.rst +++ b/docs/extensions.rst @@ -79,7 +79,7 @@ installed for a French community) may load the translations once and add the translation methods to the environment at environment generation time:: translations = get_gettext_translations() - env = Environment(extensions=['jinja.ext.i18n']) + env = Environment(extensions=['jinja2.ext.i18n']) env.install_gettext_translations(translations) The `get_gettext_translations` function would return the translator for the diff --git a/docs/integration.rst b/docs/integration.rst index 64620f7..1875711 100644 --- a/docs/integration.rst +++ b/docs/integration.rst @@ -21,7 +21,7 @@ in its Babel extraction method `mapping file`_: .. sourcecode:: ini - [jinja: **/templates/**.html] + [jinja2: **/templates/**.html] encoding = utf-8 The syntax related options of the :class:`Environment` are also available as @@ -30,7 +30,7 @@ that templates use ``%`` as `line_statement_prefix` you can use this code: .. sourcecode:: ini - [jinja: **/templates/**.html] + [jinja2: **/templates/**.html] encoding = utf-8 line_statement_prefix = % diff --git a/docs/switching.rst b/docs/switching.rst index 71ee7d8..98303fe 100644 --- a/docs/switching.rst +++ b/docs/switching.rst @@ -70,26 +70,15 @@ Filters and Tests Templates ~~~~~~~~~ -Jinja2 has mostly the same syntax as Jinja1. The only difference is that -assigning variables doesn't use `set` as keyword now. The following -example shows a Jinja1 variable assignment:: +Jinja2 has mostly the same syntax as Jinja1. What's different is that +macros require parentheses around the argument list now. - {% set foo = 42 %} - -In Jinja2 the `set` is ommited:: - - {% foo = 42 %} - -Additionally macros require parentheses around the argument list now. - -Jinja2 allows dynamic inheritance now and dynamic includes. The old helper -function `rendertemplate` is gone now, `include` can be used instead. -Additionally includes no longer import macros and variable assignments, for +Additionally Jinja2 allows dynamic inheritance now and dynamic includes. +The old helper function `rendertemplate` is gone now, `include` can be used +instead. Includes no longer import macros and variable assignments, for that the new `import` tag is used. This concept is explained in the :ref:`import` documentation. -Currently there is no support for the `recursive` modifier of for loops! - Django ------ diff --git a/docs/tricks.rst b/docs/tricks.rst index 1cfdaa8..051c6fa 100644 --- a/docs/tricks.rst +++ b/docs/tricks.rst @@ -1,9 +1,9 @@ -Tipps and Tricks -================ +Tips and Tricks +=============== .. highlight:: html+jinja -This part of the documentation shows some tipps and tricks for Jinja2 +This part of the documentation shows some tips and tricks for Jinja2 templates. -- 2.26.2