Name.Decorator: '#686868',
String: '#BE9B5D',
- Number: '#FF0000',
+ Number: '#444444',
Generic.Heading: 'bold #000080',
Generic.Subheading: 'bold #800080',
If Expression
~~~~~~~~~~~~~
-blah
+It is also possible to use inline `if` expressions. These are useful in some
+situations. For example you can use this to extend from one template if a
+variable is defined, otherwise from the default layout template:
+
+.. sourcecode:: jinja
+
+ {% extends layout_template if layout_template is defined else 'master.html' %}
.. _builtin-filters:
</ul>
As you can see it automatically prepends a space in front of the item
- if the filter returned something unless the second parameter is `False`.
+ if the filter returned something unless the second parameter is false.
"""
rv = u' '.join(
u'%s="%s"' % (escape(key), escape(value))
def do_sort(value, reverse=False):
"""Sort a sequence. Per default it sorts ascending, if you pass it
- `True` as first argument it will reverse the sorting.
+ true as first argument it will reverse the sorting.
"""
return sorted(value, reverse=reverse)