summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2019-12-01 19:30:55 +0000
committerMarcel Hellkamp <marc@gsites.de>2019-12-01 20:30:55 +0100
commita194622e0ba69a9af0c4ed27e49b6ecefa7e00d2 (patch)
treecdad07b9e47e035add86fdb58fbbf83167843421
parentb23f2e84b3fb6ac8247b8523fd9a80c5e4a1675e (diff)
downloadbottle-a194622e0ba69a9af0c4ed27e49b6ecefa7e00d2.tar.gz
Updated documentation on SimpleTemplate and embedded blocks. (#1028)
* Updated documentation on SimpleTemplate and embedded blocks. * Addressed review comments.
-rwxr-xr-xdocs/stpl.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/stpl.rst b/docs/stpl.rst
index 155b4b9..bee165f 100755
--- a/docs/stpl.rst
+++ b/docs/stpl.rst
@@ -95,6 +95,21 @@ Both the ``%`` and the ``<%`` tokens are only recognized if they are the first n
If you find yourself needing to escape a lot, consider using :ref:`custom tokens <stpl-custom-tokens>`.
+Note that ``%`` and ``<% %>`` work in *exactly* the same way. The latter is only a convenient way to type less and avoid clutter for longer code segments. This means that in ``<% %>`` blocks, all indented code must be terminated with an ``end``, as in the following example::
+
+ <%
+ if some_condition:
+ some_operation()
+ elif some_other_condition:
+ some_other_operation()
+ else:
+ yet_another_operation()
+ if yet_another_condition:
+ some_more_stuff()
+ end
+ end
+ %>
+
Whitespace Control
-----------------------