summaryrefslogtreecommitdiff
path: root/docs/devel_guide_src/comments.tex
blob: 4a7bdbdd00c417a690704d83ecf08cd629a2548e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Directives: Comments}
\label{comments}

The template:

\begin{verbatim}
Text before the comment.
## The comment.
Text after the comment.
#* A multi-line comment spanning several lines.
   It spans several lines, too.
*# 
Text after the multi-line comment.
\end{verbatim}

The output:

\begin{verbatim}
Text before the comment.
Text after the comment.

Text after the multi-line comment.

\end{verbatim}

The generated code:

\begin{verbatim}
        write('Text before the comment.\n')
        #  The comment.
        write('Text after the comment.\n')
        #  A multi-line comment spanning several lines.
        #    It spans several lines, too.
        write('\nText after the multi-line comment.\n')
\end{verbatim}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Docstring and header comments}
\label{comments.docstring}

The template:
\begin{verbatim}
##doc: .respond() method comment.
##doc-method: Another .respond() method comment.
##doc-class: A class comment.
##doc-module: A module comment.
##header: A header comment.
\end{verbatim}

The output:
\begin{verbatim}

\end{verbatim}

The beginning of the generated \code{.respond} method:
\begin{verbatim}
def respond(self,
        trans=None,
        dummyTrans=False,
        VFS=valueFromSearchList,
        VFN=valueForName,
        getmtime=getmtime,
        currentTime=time.time):

    """
    This is the main method generated by Cheetah
    .respond() method comment.
    Another .respond() method comment.
    """
\end{verbatim}

The class docstring:
\begin{verbatim}
"""
A class comment.

Autogenerated by CHEETAH: The Python-Powered Template Engine
"""
\end{verbatim}

The top of the module:
\begin{verbatim}
#!/usr/bin/env python
# A header comment.

"""A module comment.

Autogenerated by CHEETAH: The Python-Powered Template Engine
 CHEETAH VERSION: 0.9.13a1
 Generation time: Fri Apr 26 22:39:23 2002
   Source file: x.tmpl
   Source file last modified: Fri Apr 26 22:36:23 2002
"""
\end{verbatim}


% Local Variables:
% TeX-master: "devel_guide"
% End: