- debugging system improved, smaller filesize for the cached files.
Debugging works now well for any module using linecache.
+- ``{{ debug() }}`` can now be used to get a list of filters and
+ tags.
+
- added whitespace management system for the template designer.
- some small bugfixes.
[[list_of_tests]]
+*new in Jinja 1.1*:
+
+Because the application can provide additional tests you can get a documentation
+of all the provided tests by calling ``debug.tests()``:
+
+.. sourcecode:: jinja
+
+ {{ debug.tests() }}
+ -> returns a plain text representation of all the tests
+
+ {{ debug.tests(False) }}
+ -> same as above but without the builtin ones.
+
+
Global Functions
================
return '\n\n'.join(result)
filters.jinja_context_callable = True
+ def tests(self, env, context, builtins=True):
+ """List the tests."""
+ from inspect import getdoc
+ strip = set()
+ if not builtins:
+ from jinja.defaults import DEFAULT_TESTS
+ strip = set(DEFAULT_TESTS.values())
+ tests = env.tests.items()
+ tests.sort(lambda a, b: cmp(a[0].lower(), b[0].lower()))
+ result = []
+ for name, f in tests:
+ if f in strip:
+ continue
+ doc = '\n'.join(' ' + x for x in (getdoc(f) or '').splitlines())
+ result.append('`%s`\n\n%s' % (name, doc))
+ return '\n\n'.join(result)
+ tests.jinja_context_callable = True
+
def __str__(self):
print 'use debug() for debugging the context'