From 5e645ab25c0798c2e038f37a249cd74ea57bdde9 Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 4 Oct 2019 19:00:11 -0700 Subject: document debug extension --- docs/templates.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'docs/templates.rst') diff --git a/docs/templates.rst b/docs/templates.rst index 59a34dd..f6fb609 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -1658,6 +1658,29 @@ Note that ``loop.index`` starts with 1, and ``loop.index0`` starts with 0 (See: :ref:`for-loop`). +Debug Statement +~~~~~~~~~~~~~~~ + +If the :ref:`debug-extension` is enabled, a ``{% debug %}`` tag will be +available to dump the current context as well as the available filters +and tests. This is useful to see what's available to use in the template +without setting up a debugger. + +.. code-block:: html+jinja + +
{% debug %}
+ +.. code-block:: text + + {'context': {'cycler': , + ..., + 'namespace': }, + 'filters': ['abs', 'attr', 'batch', 'capitalize', 'center', 'count', 'd', + ..., 'urlencode', 'urlize', 'wordcount', 'wordwrap', 'xmlattr'], + 'tests': ['!=', '<', '<=', '==', '>', '>=', 'callable', 'defined', + ..., 'odd', 'sameas', 'sequence', 'string', 'undefined', 'upper']} + + With Statement ~~~~~~~~~~~~~~ -- cgit v1.2.1