Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3696 -- Fixed inline documentation to avoid some HTML validity…

… issues.

Patch from Simon Greenhill.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ee1ca89dd40442232a21adb06eda793795eec18d 1 parent 659aa8f
Malcolm Tredinnick authored March 10, 2007

Showing 1 changed file with 31 additions and 20 deletions. Show diff stats Hide diff stats

  1. 51  django/template/defaulttags.py
51  django/template/defaulttags.py
@@ -435,6 +435,15 @@ def cycle(parser, token):
435 435
 cycle = register.tag(cycle)
436 436
 
437 437
 def debug(parser, token):
  438
+    """
  439
+    Output a whole load of debugging information, including the current context and imported modules.
  440
+
  441
+    Sample usage::
  442
+
  443
+        <pre>
  444
+            {% debug %}
  445
+        </pre>
  446
+    """
438 447
     return DebugNode()
439 448
 debug = register.tag(debug)
440 449
 
@@ -538,21 +547,6 @@ def do_for(parser, token):
538 547
 do_for = register.tag("for", do_for)
539 548
 
540 549
 def do_ifequal(parser, token, negate):
541  
-    """
542  
-    Output the contents of the block if the two arguments equal/don't equal each other.
543  
-
544  
-    Examples::
545  
-
546  
-        {% ifequal user.id comment.user_id %}
547  
-            ...
548  
-        {% endifequal %}
549  
-
550  
-        {% ifnotequal user.id comment.user_id %}
551  
-            ...
552  
-        {% else %}
553  
-            ...
554  
-        {% endifnotequal %}
555  
-    """
556 550
     bits = list(token.split_contents())
557 551
     if len(bits) != 3:
558 552
         raise TemplateSyntaxError, "%r takes two arguments" % bits[0]
@@ -568,11 +562,27 @@ def do_ifequal(parser, token, negate):
568 562
 
569 563
 #@register.tag
570 564
 def ifequal(parser, token):
  565
+    """
  566
+    Output the contents of the block if the two arguments equal each other.
  567
+
  568
+    Examples::
  569
+
  570
+        {% ifequal user.id comment.user_id %}
  571
+            ...
  572
+        {% endifequal %}
  573
+
  574
+        {% ifnotequal user.id comment.user_id %}
  575
+            ...
  576
+        {% else %}
  577
+            ...
  578
+        {% endifnotequal %}
  579
+    """
571 580
     return do_ifequal(parser, token, False)
572 581
 ifequal = register.tag(ifequal)
573 582
 
574 583
 #@register.tag
575 584
 def ifnotequal(parser, token):
  585
+    """Output the contents of the block if the two arguments are not equal. See ifequal"""
576 586
     return do_ifequal(parser, token, True)
577 587
 ifnotequal = register.tag(ifnotequal)
578 588
 
@@ -889,8 +899,9 @@ def templatetag(parser, token):
889 899
 
890 900
 def url(parser, token):
891 901
     """
892  
-    Returns an absolute URL matching given view with its parameters. This is a
893  
-    way to define links that aren't tied to a particular url configuration:
  902
+    Returns an absolute URL matching given view with its parameters. 
  903
+    
  904
+    This is a way to define links that aren't tied to a particular url configuration::
894 905
     
895 906
         {% url path.to.some_view arg1,arg2,name1=value1 %}
896 907
     
@@ -901,16 +912,16 @@ def url(parser, token):
901 912
     URL. All arguments for the URL should be present.
902 913
 
903 914
     For example if you have a view ``app_name.client`` taking client's id and
904  
-    the corresponding line in a urlconf looks like this:
  915
+    the corresponding line in a urlconf looks like this::
905 916
     
906 917
         ('^client/(\d+)/$', 'app_name.client')
907 918
     
908 919
     and this app's urlconf is included into the project's urlconf under some
909  
-    path:
  920
+    path::
910 921
     
911 922
         ('^clients/', include('project_name.app_name.urls'))
912 923
     
913  
-    then in a template you can create a link for a certain client like this:
  924
+    then in a template you can create a link for a certain client like this::
914 925
     
915 926
         {% url app_name.client client.id %}
916 927
     

0 notes on commit ee1ca89

Please sign in to comment.
Something went wrong with that request. Please try again.