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