Updating documentation for whitespace trim tags.
authorMark Story <mark@mark-story.com>
Thu, 14 Apr 2011 02:15:32 +0000 (22:15 -0400)
committerMark Story <mark@mark-story.com>
Thu, 14 Apr 2011 02:15:32 +0000 (22:15 -0400)
doc/templates.rst

index da8de89..e0b3a2d 100644 (file)
@@ -162,19 +162,29 @@ Use the ``spaceless`` tag to remove whitespace between HTML tags:
 
 In addition to the spaceless tag you can also control whitespace on a per tag 
 level.  By using the whitespace control modifier on your tags you can trim
-leading and or trailing horizontal whitespace from any tag type:
+leading and or trailing whitespace from any tag type:
 
 .. code-block:: jinja
 
+    {% set value = 'no spaces' %}
     {#- No leading/trailing whitespace -#}
-    {%- if condition -%}
+    {%- if true -%}
         {{- value -}}
     {%- endif -%}
 
+    {# output 'spaces' #}
+
 The above sample shows the default whitespace control modifier, and how you can
-use it to remove whitespace around tags.  Only horizontal space will be removed
-any vertical space (newlines) will need to be removed with the 
-``spaceless`` tag.
+use it to remove whitespace around tags.  Trimming space will consume all whitespace
+for that side of the tag.  It is possible to use whitespace trimming on one side
+of a tag:
+
+.. code-block:: jinja
+
+    {% set value = 'no spaces' %}
+    <li>    {{- value }}    </li>
+
+    {# outputs '<li>value    </li>' #}
 
 ..versionadded:: 1.1