| | 50 | |
| | 51 | .. Note: Directives libraries are similar to JSP tag libraries and are a new feature |
| | 52 | of Genshi. |
| | 53 | |
| | 54 | |
| | 55 | Namespaces |
| | 56 | ========== |
| | 57 | |
| | 58 | .. _`namespace`: |
| | 59 | |
| | 60 | ``{% namespace %}`` |
| | 61 | ------------------- |
| | 62 | |
| | 63 | Declares a new namespace for use with Genshi directives. Individual directives |
| | 64 | being used in the template will have to be prefixed by the namespace alias |
| | 65 | defined as part of the namespace declaration. |
| | 66 | |
| | 67 | The default namespace is "http://genshi.edgewall.org/". All non prefixed |
| | 68 | directives will be looked up from that namespace. If a prefix was defined, |
| | 69 | and there is also a valid namespace declaration for it, then that namespace |
| | 70 | will be used instead for looking up the directive. |
| | 71 | |
| | 72 | .. code-block:: genshitext |
| | 73 | |
| | 74 | {% namespace "http://genshi.edgewall.org/" %} |
| | 75 | {% namespace py "http://genshi.edgewall.org/" %} |
| | 76 | {% namespace foo "http://foo.example.org/" %} |
| | 77 | |
| | 78 | # use if directive from default namespace |
| | 79 | |
| | 80 | {% if ... %} |
| | 81 | |
| | 82 | # use bar directive from foo namespace |
| | 83 | |
| | 84 | {% foo:bar ... %} |
| | 85 | |
| | 86 | # use if directive (from default namespace) |
| | 87 | |
| | 88 | {% py:if ... %} |
| | 89 | |
| | 90 | More information on directives libraries can be found |
| | 91 | under `Pluggable Directives Libraries <directives_libraries.html>`_. |
| | 92 | |