|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2005 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing templates for the documentation generator (lists style). |
|
8 """ |
|
9 |
|
10 ################################################# |
|
11 ## Template for the CSS style sheet file ## |
|
12 ################################################# |
|
13 |
|
14 cssTemplate = '''body {{ |
|
15 color: {BodyColor}; |
|
16 background: {BodyBgColor}; |
|
17 margin: 0em 1em 10em 1em; |
|
18 }} |
|
19 |
|
20 h1 {{ |
|
21 color: {Level1HeaderColor}; |
|
22 background: {Level1HeaderBgColor}; |
|
23 }} |
|
24 |
|
25 h2 {{ |
|
26 color: {CFColor}; |
|
27 background: {CFBgColor}; |
|
28 }} |
|
29 |
|
30 h3 {{ |
|
31 color: {Level2HeaderColor}; |
|
32 background: {Level2HeaderBgColor}; |
|
33 }} |
|
34 |
|
35 h4 {{ |
|
36 color: {Level2HeaderColor}; |
|
37 background: {Level2HeaderBgColor}; |
|
38 }} |
|
39 |
|
40 a {{ |
|
41 color: {LinkColor}; |
|
42 }} |
|
43 ''' |
|
44 |
|
45 ################################################# |
|
46 ## Common templates for index and docu files ## |
|
47 ################################################# |
|
48 |
|
49 headerTemplate = '''<!DOCTYPE html> |
|
50 <html><head> |
|
51 <title>{Title}</title> |
|
52 <meta charset="UTF-8"> |
|
53 <link rel="stylesheet" href="styles.css"> |
|
54 </head> |
|
55 <body>''' |
|
56 |
|
57 footerTemplate = ''' |
|
58 </body></html>''' |
|
59 |
|
60 ######################################### |
|
61 ## Templates for documentation files ## |
|
62 ######################################### |
|
63 |
|
64 moduleTemplate = ''' |
|
65 <a NAME="top" ID="top"></a> |
|
66 <h1>{Module}</h1> |
|
67 {ModuleDescription} |
|
68 <h3>Global Attributes</h3> |
|
69 {GlobalsList} |
|
70 <h3>Classes</h3> |
|
71 {ClassList} |
|
72 <h3>Functions</h3> |
|
73 {FunctionList} |
|
74 <hr />''' |
|
75 |
|
76 rbFileTemplate = ''' |
|
77 <a NAME="top" ID="top"></a> |
|
78 <h1>{Module}</h1> |
|
79 {ModuleDescription} |
|
80 <h3>Global Attributes</h3> |
|
81 {GlobalsList} |
|
82 <h3>Classes</h3> |
|
83 {ClassList} |
|
84 <h3>Modules</h3> |
|
85 {RbModulesList} |
|
86 <h3>Functions</h3> |
|
87 {FunctionList} |
|
88 <hr />''' |
|
89 |
|
90 classTemplate = ''' |
|
91 <hr /> |
|
92 <a NAME="{Anchor}" ID="{Anchor}"></a> |
|
93 <h2>{Class}</h2> |
|
94 {ClassDescription} |
|
95 <h3>Derived from</h3> |
|
96 {ClassSuper} |
|
97 <h3>Class Attributes</h3> |
|
98 {GlobalsList} |
|
99 <h3>Class Methods</h3> |
|
100 {ClassMethodList} |
|
101 <h3>Methods</h3> |
|
102 {MethodList} |
|
103 <h3>Static Methods</h3> |
|
104 {StaticMethodList} |
|
105 {MethodDetails} |
|
106 <div align="right"><a href="#top">Up</a></div> |
|
107 <hr />''' |
|
108 |
|
109 methodTemplate = ''' |
|
110 <a NAME="{Anchor}.{Method}" ID="{Anchor}.{Method}"></a> |
|
111 <h4>{Class}.{Method}{MethodClassifier}</h4> |
|
112 <b>{Method}</b>(<i>{Params}</i>) |
|
113 {MethodDescription}''' |
|
114 |
|
115 constructorTemplate = ''' |
|
116 <a NAME="{Anchor}.{Method}" ID="{Anchor}.{Method}"></a> |
|
117 <h4>{Class} (Constructor)</h4> |
|
118 <b>{Class}</b>(<i>{Params}</i>) |
|
119 {MethodDescription}''' |
|
120 |
|
121 rbModuleTemplate = ''' |
|
122 <hr /> |
|
123 <a NAME="{Anchor}" ID="{Anchor}"></a> |
|
124 <h2>{Module}</h2> |
|
125 {ModuleDescription} |
|
126 <h3>Module Attributes</h3> |
|
127 {GlobalsList} |
|
128 <h3>Classes</h3> |
|
129 {ClassesList} |
|
130 <h3>Functions</h3> |
|
131 {FunctionsList} |
|
132 <hr /> |
|
133 {ClassesDetails} |
|
134 {FunctionsDetails} |
|
135 <div align="right"><a href="#top">Up</a></div> |
|
136 <hr />''' |
|
137 |
|
138 rbModulesClassTemplate = ''' |
|
139 <a NAME="{Anchor}" ID="{Anchor}"></a> |
|
140 <h2>{Class}</h2> |
|
141 {ClassDescription} |
|
142 <h3>Derived from</h3> |
|
143 {ClassSuper} |
|
144 <h3>Methods</h3> |
|
145 {MethodList} |
|
146 {MethodDetails} |
|
147 <div align="right"><a href="#top">Up</a></div> |
|
148 <hr />''' |
|
149 |
|
150 functionTemplate = ''' |
|
151 <hr /> |
|
152 <a NAME="{Anchor}" ID="{Anchor}"></a> |
|
153 <h2>{Function}</h2> |
|
154 <b>{Function}</b>(<i>{Params}</i>) |
|
155 {FunctionDescription} |
|
156 <div align="right"><a href="#top">Up</a></div> |
|
157 <hr />''' |
|
158 |
|
159 listTemplate = ''' |
|
160 <table> |
|
161 {Entries} |
|
162 </table>''' |
|
163 |
|
164 listEntryTemplate = ''' |
|
165 <tr> |
|
166 <td><a href="#{Link}">{Name}</a></td> |
|
167 <td>{Deprecated}{Description}</td> |
|
168 </tr>''' |
|
169 |
|
170 listEntryNoneTemplate = '''<tr><td>None</td></tr>''' |
|
171 |
|
172 listEntryDeprecatedTemplate = '''<b>Deprecated.</b>''' |
|
173 |
|
174 listEntrySimpleTemplate = '''<tr><td>{Name}</td></tr>''' |
|
175 |
|
176 paragraphTemplate = ''' |
|
177 <p> |
|
178 {Lines} |
|
179 </p>''' |
|
180 |
|
181 parametersListTemplate = ''' |
|
182 <dl> |
|
183 {Parameters} |
|
184 </dl>''' |
|
185 |
|
186 parametersListEntryTemplate = ''' |
|
187 <dt><i>{Name}</i></dt> |
|
188 <dd> |
|
189 {Description} |
|
190 </dd>''' |
|
191 |
|
192 parameterTypesListEntryTemplate = ''' |
|
193 <dt><i>{Name}</i> ({Type})</dt> |
|
194 <dd> |
|
195 {Description} |
|
196 </dd>''' |
|
197 |
|
198 returnsTemplate = ''' |
|
199 <dl> |
|
200 <dt>Return:</dt> |
|
201 <dd> |
|
202 {0} |
|
203 </dd> |
|
204 </dl>''' |
|
205 |
|
206 returnTypesTemplate = ''' |
|
207 <dl> |
|
208 <dt>Return Type:</dt> |
|
209 <dd> |
|
210 {0} |
|
211 </dd> |
|
212 </dl>''' |
|
213 |
|
214 yieldsTemplate = ''' |
|
215 <dl> |
|
216 <dt>Yield:</dt> |
|
217 <dd> |
|
218 {0} |
|
219 </dd> |
|
220 </dl>''' |
|
221 |
|
222 yieldTypesTemplate = ''' |
|
223 <dl> |
|
224 <dt>Yield Type:</dt> |
|
225 <dd> |
|
226 {0} |
|
227 </dd> |
|
228 </dl>''' |
|
229 |
|
230 exceptionsListTemplate = ''' |
|
231 <dl> |
|
232 {Exceptions} |
|
233 </dl>''' |
|
234 |
|
235 exceptionsListEntryTemplate = ''' |
|
236 <dt>Raises <b>{Name}</b>:</dt> |
|
237 <dd> |
|
238 {Description} |
|
239 </dd>''' |
|
240 |
|
241 signalsListTemplate = ''' |
|
242 <h3>Signals</h3> |
|
243 <dl> |
|
244 {Signals} |
|
245 </dl>''' |
|
246 |
|
247 signalsListEntryTemplate = ''' |
|
248 <dt>{Name}</dt> |
|
249 <dd> |
|
250 {Description} |
|
251 </dd>''' |
|
252 |
|
253 eventsListTemplate = ''' |
|
254 <h3>Events</h3> |
|
255 <dl> |
|
256 {Events} |
|
257 </dl>''' |
|
258 |
|
259 eventsListEntryTemplate = ''' |
|
260 <dt>{Name}</dt> |
|
261 <dd> |
|
262 {Description} |
|
263 </dd>''' |
|
264 |
|
265 deprecatedTemplate = ''' |
|
266 <p> |
|
267 <b>Deprecated.</b> |
|
268 {Lines} |
|
269 </p>''' |
|
270 |
|
271 authorInfoTemplate = ''' |
|
272 <p> |
|
273 <i>Author(s)</i>: |
|
274 {Authors} |
|
275 </p>''' |
|
276 |
|
277 seeListTemplate = ''' |
|
278 <dl> |
|
279 <dt><b>See Also:</b></dt> |
|
280 {Links} |
|
281 </dl>''' |
|
282 |
|
283 seeListEntryTemplate = ''' |
|
284 <dd> |
|
285 {Link} |
|
286 </dd>''' |
|
287 |
|
288 seeLinkTemplate = '''<a {Link}''' |
|
289 |
|
290 sinceInfoTemplate = ''' |
|
291 <p> |
|
292 <b>since</b> {Info} |
|
293 </p>''' |
|
294 |
|
295 ################################# |
|
296 ## Templates for index files ## |
|
297 ################################# |
|
298 |
|
299 indexBodyTemplate = ''' |
|
300 <h1>{Title}</h1> |
|
301 {Description} |
|
302 {Subpackages} |
|
303 {Modules}''' |
|
304 |
|
305 indexListPackagesTemplate = ''' |
|
306 <h3>Packages</h3> |
|
307 <table> |
|
308 {Entries} |
|
309 </table>''' |
|
310 |
|
311 indexListModulesTemplate = ''' |
|
312 <h3>Modules</h3> |
|
313 <table> |
|
314 {Entries} |
|
315 </table>''' |
|
316 |
|
317 indexListEntryTemplate = ''' |
|
318 <tr> |
|
319 <td><a href="{Link}">{Name}</a></td> |
|
320 <td>{Description}</td> |
|
321 </tr>''' |
|
322 |
|
323 # |
|
324 # eflag: noqa = E122 |