summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2013-05-20 09:26:57 +0100
committerArmin Ronacher <armin.ronacher@active-4.com>2013-05-20 09:26:57 +0100
commit568352e07d74cb4f333d47ae054de3a2991b97ba (patch)
tree1443ddb9d161a701936a7cce417d993cc3ada61d /docs
parentdcd0cb73120e2d924e7064933cefd3246f3cfffa (diff)
downloadjinja2-568352e07d74cb4f333d47ae054de3a2991b97ba.tar.gz
Documented loop.depth and added loop.depth0.
Diffstat (limited to 'docs')
-rw-r--r--docs/templates.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/templates.rst b/docs/templates.rst
index 6bc6e04..e0a19fa 100644
--- a/docs/templates.rst
+++ b/docs/templates.rst
@@ -576,6 +576,12 @@ Inside of a for-loop block you can access some special variables:
| `loop.cycle` | A helper function to cycle between a list of |
| | sequences. See the explanation below. |
+-----------------------+---------------------------------------------------+
+| `loop.depth` | Indicates how deep in deep in a recursive loop |
+| | the rendering currently is. Starts at level 1 |
++-----------------------+---------------------------------------------------+
+| `loop.depth0 | Indicates how deep in deep in a recursive loop |
+| | the rendering currently is. Starts at level 0 |
++-----------------------+---------------------------------------------------+
Within a for-loop, it's possible to cycle among a list of strings/variables
each time through the loop by using the special `loop.cycle` helper::