From 78669a66d08e3a5970d50668be86ae8bf28dd304 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 16 Oct 2012 07:57:52 +0200 Subject: [PATCH] fixed import doc --- doc/tags/import.rst | 28 +++------------------------- 1 files changed, 3 insertions(+), 25 deletions(-) diff --git a/doc/tags/import.rst b/doc/tags/import.rst index 8d47b36..f6bf718 100644 --- a/doc/tags/import.rst +++ b/doc/tags/import.rst @@ -49,31 +49,9 @@ namespace:

{{ textarea('comment') }}

-Importing is not needed if the macros and the template are defined in the same -file; use the special ``_self`` variable instead: +.. tip:: -.. code-block:: jinja - - {# index.html template #} - - {% macro textarea(name, value, rows) %} - - {% endmacro %} - -

{{ _self.textarea('comment') }}

- -But you can still create an alias by importing from the ``_self`` variable: - -.. code-block:: jinja - - {# index.html template #} - - {% macro textarea(name, value, rows) %} - - {% endmacro %} - - {% import _self as forms %} - -

{{ forms.textarea('comment') }}

+ To import macros from the current file, use the special ``_self`` variable + for the source. .. seealso:: :doc:`macro<../tags/macro>`, :doc:`from<../tags/from>` -- 1.7.2.5