|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2004 - 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing templates for the documentation generator (lists style). |
|
8 """ |
|
9 |
|
10 ################################################# |
|
11 ## Common templates for index and docu files ## |
|
12 ################################################# |
|
13 |
|
14 headerTemplate = \ |
|
15 '''<?xml version="1.0" encoding="utf-8"?> |
|
16 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
17 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
18 <html><head> |
|
19 <title>%%(Title)s</title> |
|
20 </head> |
|
21 <body style="background-color:%(BodyBgColor)s;color:%(BodyColor)s">''' |
|
22 |
|
23 footerTemplate = ''' |
|
24 </body></html>''' |
|
25 |
|
26 ######################################### |
|
27 ## Templates for documentation files ## |
|
28 ######################################### |
|
29 |
|
30 moduleTemplate = \ |
|
31 '''<a NAME="top" ID="top"></a> |
|
32 <h1 style="background-color:%(Level1HeaderBgColor)s;color:%(Level1HeaderColor)s">%%(Module)s</h1> |
|
33 %%(ModuleDescription)s |
|
34 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Global Attributes</h3> |
|
35 %%(GlobalsList)s |
|
36 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Classes</h3> |
|
37 %%(ClassList)s |
|
38 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Functions</h3> |
|
39 %%(FunctionList)s |
|
40 <hr />''' |
|
41 |
|
42 rbFileTemplate = \ |
|
43 '''<a NAME="top" ID="top"></a> |
|
44 <h1 style="background-color:%(Level1HeaderBgColor)s;color:%(Level1HeaderColor)s">%%(Module)s</h1> |
|
45 %%(ModuleDescription)s |
|
46 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Global Attributes</h3> |
|
47 %%(GlobalsList)s |
|
48 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Classes</h3> |
|
49 %%(ClassList)s |
|
50 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Modules</h3> |
|
51 %%(RbModulesList)s |
|
52 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Functions</h3> |
|
53 %%(FunctionList)s |
|
54 <hr />''' |
|
55 |
|
56 classTemplate = \ |
|
57 '''<hr /> |
|
58 <a NAME="%%(Anchor)s" ID="%%(Anchor)s"></a> |
|
59 <h2 style="background-color:%(CFBgColor)s;color:%(CFColor)s">%%(Class)s</h2> |
|
60 %%(ClassDescription)s |
|
61 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Derived from</h3> |
|
62 %%(ClassSuper)s |
|
63 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Class Attributes</h3> |
|
64 %%(GlobalsList)s |
|
65 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Methods</h3> |
|
66 %%(MethodList)s |
|
67 %%(MethodDetails)s |
|
68 <div align="right"><a style="color:%(LinkColor)s" href="#top">Up</a></div> |
|
69 <hr />''' |
|
70 |
|
71 methodTemplate = \ |
|
72 '''<a NAME="%%(Anchor)s.%%(Method)s" ID="%%(Anchor)s.%%(Method)s"></a> |
|
73 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">%%(Class)s.%%(Method)s</h3> |
|
74 <b>%%(Method)s</b>(<i>%%(Params)s</i>) |
|
75 %%(MethodDescription)s''' |
|
76 |
|
77 constructorTemplate = \ |
|
78 '''<a NAME="%%(Anchor)s.%%(Method)s" ID="%%(Anchor)s.%%(Method)s"></a> |
|
79 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">%%(Class)s (Constructor)</h3> |
|
80 <b>%%(Class)s</b>(<i>%%(Params)s</i>) |
|
81 %%(MethodDescription)s''' |
|
82 |
|
83 rbModuleTemplate = \ |
|
84 '''<hr /> |
|
85 <a NAME="%%(Anchor)s" ID="%%(Anchor)s"></a> |
|
86 <h2 style="background-color:%(CFBgColor)s;color:%(CFColor)s">%%(Module)s</h2> |
|
87 %%(ModuleDescription)s |
|
88 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Module Attributes</h3> |
|
89 %%(GlobalsList)s |
|
90 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Classes</h3> |
|
91 %%(ClassesList)s |
|
92 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Functions</h3> |
|
93 %%(FunctionsList)s |
|
94 <hr /> |
|
95 %%(ClassesDetails)s |
|
96 %%(FunctionsDetails)s |
|
97 <div align="right"><a style="color:%(LinkColor)s" href="#top">Up</a></div> |
|
98 <hr />''' |
|
99 |
|
100 rbModulesClassTemplate = \ |
|
101 '''<a NAME="%%(Anchor)s" ID="%%(Anchor)s"></a> |
|
102 <h2 style="background-color:%(CFBgColor)s;color:%(CFColor)s">%%(Class)s</h2> |
|
103 %%(ClassDescription)s |
|
104 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Derived from</h3> |
|
105 %%(ClassSuper)s |
|
106 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Methods</h3> |
|
107 %%(MethodList)s |
|
108 %%(MethodDetails)s |
|
109 <div align="right"><a style="color:%(LinkColor)s" href="#top">Up</a></div> |
|
110 <hr />''' |
|
111 |
|
112 functionTemplate = \ |
|
113 '''<hr /> |
|
114 <a NAME="%%(Anchor)s" ID="%%(Anchor)s"></a> |
|
115 <h2 style="background-color:%(CFBgColor)s;color:%(CFColor)s">%%(Function)s</h2> |
|
116 <b>%%(Function)s</b>(<i>%%(Params)s</i>) |
|
117 %%(FunctionDescription)s |
|
118 <div align="right"><a style="color:%(LinkColor)s" href="#top">Up</a></div> |
|
119 <hr />''' |
|
120 |
|
121 listTemplate = \ |
|
122 '''<table> |
|
123 %%(Entries)s |
|
124 </table>''' |
|
125 |
|
126 listEntryTemplate = \ |
|
127 '''<tr> |
|
128 <td><a style="color:%(LinkColor)s" href="#%%(Link)s">%%(Name)s</a></td> |
|
129 <td>%%(Deprecated)s%%(Description)s</td> |
|
130 </tr>''' |
|
131 |
|
132 listEntryNoneTemplate = \ |
|
133 '''<tr><td>None</td></tr>''' |
|
134 |
|
135 listEntryDeprecatedTemplate = \ |
|
136 '''<b>Deprecated.</b>''' |
|
137 |
|
138 listEntrySimpleTemplate = \ |
|
139 '''<tr><td>%%(Name)s</td></tr>''' |
|
140 |
|
141 paragraphTemplate = \ |
|
142 '''<p> |
|
143 %%(Lines)s |
|
144 </p>''' |
|
145 |
|
146 parametersListTemplate = \ |
|
147 '''<dl> |
|
148 %%(Parameters)s |
|
149 </dl>''' |
|
150 |
|
151 parametersListEntryTemplate = \ |
|
152 '''<dt><i>%%(Name)s</i></dt> |
|
153 <dd> |
|
154 %%(Description)s |
|
155 </dd>''' |
|
156 |
|
157 returnsTemplate = \ |
|
158 '''<dl> |
|
159 <dt>Returns:</dt> |
|
160 <dd> |
|
161 %%s |
|
162 </dd> |
|
163 </dl>''' |
|
164 |
|
165 exceptionsListTemplate = \ |
|
166 '''<dl> |
|
167 %%(Exceptions)s |
|
168 </dl>''' |
|
169 |
|
170 exceptionsListEntryTemplate = \ |
|
171 '''<dt>Raises <b>%%(Name)s</b>:</dt> |
|
172 <dd> |
|
173 %%(Description)s |
|
174 </dd>''' |
|
175 |
|
176 signalsListTemplate = \ |
|
177 '''<h4>Signals</h4> |
|
178 <dl> |
|
179 %%(Signals)s |
|
180 </dl>''' |
|
181 |
|
182 signalsListEntryTemplate = \ |
|
183 '''<dt>%%(Name)s</dt> |
|
184 <dd> |
|
185 %%(Description)s |
|
186 </dd>''' |
|
187 |
|
188 eventsListTemplate = \ |
|
189 '''<h4>Events</h4> |
|
190 <dl> |
|
191 %%(Events)s |
|
192 </dl>''' |
|
193 |
|
194 eventsListEntryTemplate = \ |
|
195 '''<dt>%%(Name)s</dt> |
|
196 <dd> |
|
197 %%(Description)s |
|
198 </dd>''' |
|
199 |
|
200 deprecatedTemplate = \ |
|
201 '''<p> |
|
202 <b>Deprecated.</b> |
|
203 %%(Lines)s |
|
204 </p>''' |
|
205 |
|
206 authorInfoTemplate = \ |
|
207 '''<p> |
|
208 <i>Author(s)</i>: |
|
209 %%(Authors)s |
|
210 </p>''' |
|
211 |
|
212 seeListTemplate = \ |
|
213 '''<dl> |
|
214 <dt><b>See Also:</b></dt> |
|
215 %%(Links)s |
|
216 </dl>''' |
|
217 |
|
218 seeListEntryTemplate = \ |
|
219 '''<dd> |
|
220 %%(Link)s |
|
221 </dd>''' |
|
222 |
|
223 seeLinkTemplate = \ |
|
224 '''<a style="color:%(LinkColor)s" %%(Link)s''' |
|
225 |
|
226 sinceInfoTemplate = \ |
|
227 '''<p> |
|
228 <b>since</b> %%(Info)s |
|
229 </p>''' |
|
230 |
|
231 ################################# |
|
232 ## Templates for index files ## |
|
233 ################################# |
|
234 |
|
235 indexBodyTemplate = ''' |
|
236 <h1 style="background-color:%(Level1HeaderBgColor)s;color:%(Level1HeaderColor)s">%%(Title)s</h1> |
|
237 %%(Description)s |
|
238 %%(Subpackages)s |
|
239 %%(Modules)s''' |
|
240 |
|
241 indexListPackagesTemplate = ''' |
|
242 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Packages</h3> |
|
243 <table> |
|
244 %%(Entries)s |
|
245 </table>''' |
|
246 |
|
247 indexListModulesTemplate = ''' |
|
248 <h3 style="background-color:%(Level2HeaderBgColor)s;color:%(Level2HeaderColor)s">Modules</h3> |
|
249 <table> |
|
250 %%(Entries)s |
|
251 </table>''' |
|
252 |
|
253 indexListEntryTemplate = \ |
|
254 '''<tr> |
|
255 <td><a style="color:%(LinkColor)s" href="%%(Link)s">%%(Name)s</a></td> |
|
256 <td>%%(Description)s</td> |
|
257 </tr>''' |