From b2a36aab95c121c32197f0d64144d32ce6e6cb6f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 28 Apr 2008 19:57:40 +0200 Subject: [PATCH] updated jinja docs --HG-- branch : trunk --- docs/jinjaext.py | 2 +- docs/templates.rst | 8 +++++++- jinja2/filters.py | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/jinjaext.py b/docs/jinjaext.py index bd4cab6..8485a62 100644 --- a/docs/jinjaext.py +++ b/docs/jinjaext.py @@ -44,7 +44,7 @@ class JinjaStyle(Style): Name.Decorator: '#686868', String: '#BE9B5D', - Number: '#FF0000', + Number: '#444444', Generic.Heading: 'bold #000080', Generic.Subheading: 'bold #800080', diff --git a/docs/templates.rst b/docs/templates.rst index 280b166..9700cda 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -578,7 +578,13 @@ is 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: diff --git a/jinja2/filters.py b/jinja2/filters.py index 0b55760..ce8a976 100644 --- a/jinja2/filters.py +++ b/jinja2/filters.py @@ -112,7 +112,7 @@ def do_xmlattr(_environment, d, autospace=True): 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)) @@ -541,7 +541,7 @@ def do_round(value, precision=0, method='common'): 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) -- 2.26.2