comparison doc/xml-templates.txt @ 746:87dc067bd92b

Clarify description of the `py:if` directive.
author cmlenz
date Mon, 09 Jun 2008 10:07:00 +0000
parents e695f9763a03
children
comparison
equal deleted inserted replaced
745:f9544a7cc57a 746:87dc067bd92b
99 .. _`py:if`: 99 .. _`py:if`:
100 100
101 ``py:if`` 101 ``py:if``
102 --------- 102 ---------
103 103
104 The element is only rendered if the expression evaluates to a truth value: 104 The element and its content is only rendered if the expression evaluates to a
105 truth value:
105 106
106 .. code-block:: genshi 107 .. code-block:: genshi
107 108
108 <div> 109 <div>
109 <b py:if="foo">${bar}</b> 110 <b py:if="foo">${bar}</b>
114 115
115 .. code-block:: xml 116 .. code-block:: xml
116 117
117 <div> 118 <div>
118 <b>Hello</b> 119 <b>Hello</b>
120 </div>
121
122 But setting ``foo=False`` would result in the following output:
123
124 .. code-block:: xml
125
126 <div>
119 </div> 127 </div>
120 128
121 This directive can also be used as an element: 129 This directive can also be used as an element:
122 130
123 .. code-block:: genshi 131 .. code-block:: genshi
Copyright (C) 2012-2017 Edgewall Software