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