6 Comments

Comments are used to mark notes, explanations, and decorative text that should not appear in the output. Cheetah maintains the comments in the Python module it generates from the Cheetah source code. There are two forms of the comment directive: single-line and multi-line.

All text in a template definition that lies between two hash characters (##) and the end of the line is treated as a single-line comment and will not show up in the output, unless the two hash characters are escaped with a backslash.

##=============================  this is a decorative comment-bar
$var    ## this is an end-of-line comment
##=============================

Any text between #* and *# will be treated as a multi-line comment.

#*
   Here is some multiline
   comment text
*#

If you put blank lines around method definitions or loops to separate them, be aware that the blank lines will be output as is. To avoid this, make sure the blank lines are enclosed in a comment. Since you normally have a comment before the next method definition (right?), you can just extend that comment to include the blank lines after the previous method definition, like so:

#def method1
... lines ...
#end def
#*


   Description of method2.
   $arg1, string, a phrase.
*#
#def method2($arg1)
... lines ...
#end def



Subsections