From: Fabien Potencier Date: Tue, 16 Oct 2012 05:57:52 +0000 (+0200) Subject: fixed import doc X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=78669a66d08e3a5970d50668be86ae8bf28dd304;p=web%2Fkonrad%2Ftwig.git fixed import doc --- 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>`