eric6/DocumentationTools/TemplatesListsStyle.py

changeset 7252
c5e3705073eb
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7251:bc5b1b00560a 7252:c5e3705073eb
10 10
11 ################################################# 11 #################################################
12 ## Common templates for index and docu files ## 12 ## Common templates for index and docu files ##
13 ################################################# 13 #################################################
14 14
15 headerTemplate = \ 15 headerTemplate = '''<!DOCTYPE html>
16 '''<!DOCTYPE html>
17 <html><head> 16 <html><head>
18 <title>{{Title}}</title> 17 <title>{{Title}}</title>
19 <meta charset="UTF-8"> 18 <meta charset="UTF-8">
20 </head> 19 </head>
21 <body style="background-color:{BodyBgColor};color:{BodyColor}">''' 20 <body style="background-color:{BodyBgColor};color:{BodyColor}">'''
25 24
26 ######################################### 25 #########################################
27 ## Templates for documentation files ## 26 ## Templates for documentation files ##
28 ######################################### 27 #########################################
29 28
30 moduleTemplate = \ 29 moduleTemplate = '''
31 '''<a NAME="top" ID="top"></a> 30 <a NAME="top" ID="top"></a>
32 <h1 style="background-color:{Level1HeaderBgColor};color:{Level1HeaderColor}"> 31 <h1 style="background-color:{Level1HeaderBgColor};color:{Level1HeaderColor}">
33 {{Module}}</h1> 32 {{Module}}</h1>
34 {{ModuleDescription}} 33 {{ModuleDescription}}
35 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 34 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
36 Global Attributes</h3> 35 Global Attributes</h3>
41 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 40 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
42 Functions</h3> 41 Functions</h3>
43 {{FunctionList}} 42 {{FunctionList}}
44 <hr />''' 43 <hr />'''
45 44
46 rbFileTemplate = \ 45 rbFileTemplate = '''
47 '''<a NAME="top" ID="top"></a> 46 <a NAME="top" ID="top"></a>
48 <h1 style="background-color:{Level1HeaderBgColor};color:{Level1HeaderColor}"> 47 <h1 style="background-color:{Level1HeaderBgColor};color:{Level1HeaderColor}">
49 {{Module}}</h1> 48 {{Module}}</h1>
50 {{ModuleDescription}} 49 {{ModuleDescription}}
51 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 50 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
52 Global Attributes</h3> 51 Global Attributes</h3>
60 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 59 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
61 Functions</h3> 60 Functions</h3>
62 {{FunctionList}} 61 {{FunctionList}}
63 <hr />''' 62 <hr />'''
64 63
65 classTemplate = \ 64 classTemplate = '''
66 '''<hr /> 65 <hr />
67 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a> 66 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a>
68 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Class}}</h2> 67 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Class}}</h2>
69 {{ClassDescription}} 68 {{ClassDescription}}
70 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 69 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
71 Derived from</h3> 70 Derived from</h3>
84 {{StaticMethodList}} 83 {{StaticMethodList}}
85 {{MethodDetails}} 84 {{MethodDetails}}
86 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div> 85 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div>
87 <hr />''' 86 <hr />'''
88 87
89 methodTemplate = \ 88 methodTemplate = '''
90 '''<a NAME="{{Anchor}}.{{Method}}" ID="{{Anchor}}.{{Method}}"></a> 89 <a NAME="{{Anchor}}.{{Method}}" ID="{{Anchor}}.{{Method}}"></a>
91 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 90 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
92 {{Class}}.{{Method}}{{MethodClassifier}}</h3> 91 {{Class}}.{{Method}}{{MethodClassifier}}</h3>
93 <b>{{Method}}</b>(<i>{{Params}}</i>) 92 <b>{{Method}}</b>(<i>{{Params}}</i>)
94 {{MethodDescription}}''' 93 {{MethodDescription}}'''
95 94
96 constructorTemplate = \ 95 constructorTemplate = '''
97 '''<a NAME="{{Anchor}}.{{Method}}" ID="{{Anchor}}.{{Method}}"></a> 96 <a NAME="{{Anchor}}.{{Method}}" ID="{{Anchor}}.{{Method}}"></a>
98 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 97 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
99 {{Class}} (Constructor)</h3> 98 {{Class}} (Constructor)</h3>
100 <b>{{Class}}</b>(<i>{{Params}}</i>) 99 <b>{{Class}}</b>(<i>{{Params}}</i>)
101 {{MethodDescription}}''' 100 {{MethodDescription}}'''
102 101
103 rbModuleTemplate = \ 102 rbModuleTemplate = '''
104 '''<hr /> 103 <hr />
105 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a> 104 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a>
106 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Module}}</h2> 105 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Module}}</h2>
107 {{ModuleDescription}} 106 {{ModuleDescription}}
108 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 107 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
109 Module Attributes</h3> 108 Module Attributes</h3>
118 {{ClassesDetails}} 117 {{ClassesDetails}}
119 {{FunctionsDetails}} 118 {{FunctionsDetails}}
120 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div> 119 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div>
121 <hr />''' 120 <hr />'''
122 121
123 rbModulesClassTemplate = \ 122 rbModulesClassTemplate = '''
124 '''<a NAME="{{Anchor}}" ID="{{Anchor}}"></a> 123 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a>
125 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Class}}</h2> 124 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Class}}</h2>
126 {{ClassDescription}} 125 {{ClassDescription}}
127 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}"> 126 <h3 style="background-color:{Level2HeaderBgColor};color:{Level2HeaderColor}">
128 Derived from</h3> 127 Derived from</h3>
129 {{ClassSuper}} 128 {{ClassSuper}}
132 {{MethodList}} 131 {{MethodList}}
133 {{MethodDetails}} 132 {{MethodDetails}}
134 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div> 133 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div>
135 <hr />''' 134 <hr />'''
136 135
137 functionTemplate = \ 136 functionTemplate = '''
138 '''<hr /> 137 <hr />
139 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a> 138 <a NAME="{{Anchor}}" ID="{{Anchor}}"></a>
140 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Function}}</h2> 139 <h2 style="background-color:{CFBgColor};color:{CFColor}">{{Function}}</h2>
141 <b>{{Function}}</b>(<i>{{Params}}</i>) 140 <b>{{Function}}</b>(<i>{{Params}}</i>)
142 {{FunctionDescription}} 141 {{FunctionDescription}}
143 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div> 142 <div align="right"><a style="color:{LinkColor}" href="#top">Up</a></div>
144 <hr />''' 143 <hr />'''
145 144
146 listTemplate = \ 145 listTemplate = '''
147 '''<table> 146 <table>
148 {{Entries}} 147 {{Entries}}
149 </table>''' 148 </table>'''
150 149
151 listEntryTemplate = \ 150 listEntryTemplate = '''
152 '''<tr> 151 <tr>
153 <td><a style="color:{LinkColor}" href="#{{Link}}">{{Name}}</a></td> 152 <td><a style="color:{LinkColor}" href="#{{Link}}">{{Name}}</a></td>
154 <td>{{Deprecated}}{{Description}}</td> 153 <td>{{Deprecated}}{{Description}}</td>
155 </tr>''' 154 </tr>'''
156 155
157 listEntryNoneTemplate = '''<tr><td>None</td></tr>''' 156 listEntryNoneTemplate = '''<tr><td>None</td></tr>'''
158 157
159 listEntryDeprecatedTemplate = '''<b>Deprecated.</b>''' 158 listEntryDeprecatedTemplate = '''<b>Deprecated.</b>'''
160 159
161 listEntrySimpleTemplate = '''<tr><td>{{Name}}</td></tr>''' 160 listEntrySimpleTemplate = '''<tr><td>{{Name}}</td></tr>'''
162 161
163 paragraphTemplate = \ 162 paragraphTemplate = '''
164 '''<p> 163 <p>
165 {{Lines}} 164 {{Lines}}
166 </p>''' 165 </p>'''
167 166
168 parametersListTemplate = \ 167 parametersListTemplate = '''
169 '''<dl> 168 <dl>
170 {{Parameters}} 169 {{Parameters}}
171 </dl>''' 170 </dl>'''
172 171
173 parametersListEntryTemplate = \ 172 parametersListEntryTemplate = '''
174 '''<dt><i>{{Name}}</i></dt> 173 <dt><i>{{Name}}</i></dt>
175 <dd> 174 <dd>
176 {{Description}} 175 {{Description}}
177 </dd>''' 176 </dd>'''
178 177
179 parameterTypesListEntryTemplate = \ 178 parameterTypesListEntryTemplate = '''
180 '''<dt><i>{{Name}}</i> ({{Type}})</dt> 179 <dt><i>{{Name}}</i> ({{Type}})</dt>
181 <dd> 180 <dd>
182 {{Description}} 181 {{Description}}
183 </dd>''' 182 </dd>'''
184 183
185 returnsTemplate = \ 184 returnsTemplate = '''
186 '''<dl> 185 <dl>
187 <dt>Returns:</dt> 186 <dt>Returns:</dt>
188 <dd> 187 <dd>
189 {{0}} 188 {{0}}
190 </dd> 189 </dd>
191 </dl>''' 190 </dl>'''
192 191
193 returnTypesTemplate = \ 192 returnTypesTemplate = '''
194 '''<dl> 193 <dl>
195 <dt>Return Type:</dt> 194 <dt>Return Type:</dt>
196 <dd> 195 <dd>
197 {{0}} 196 {{0}}
198 </dd> 197 </dd>
199 </dl>''' 198 </dl>'''
200 199
201 exceptionsListTemplate = \ 200 exceptionsListTemplate = '''
202 '''<dl> 201 <dl>
203 {{Exceptions}} 202 {{Exceptions}}
204 </dl>''' 203 </dl>'''
205 204
206 exceptionsListEntryTemplate = \ 205 exceptionsListEntryTemplate = '''
207 '''<dt>Raises <b>{{Name}}</b>:</dt> 206 <dt>Raises <b>{{Name}}</b>:</dt>
208 <dd> 207 <dd>
209 {{Description}} 208 {{Description}}
210 </dd>''' 209 </dd>'''
211 210
212 signalsListTemplate = \ 211 signalsListTemplate = '''
213 '''<h4>Signals</h4> 212 <h4>Signals</h4>
214 <dl> 213 <dl>
215 {{Signals}} 214 {{Signals}}
216 </dl>''' 215 </dl>'''
217 216
218 signalsListEntryTemplate = \ 217 signalsListEntryTemplate = '''
219 '''<dt>{{Name}}</dt> 218 <dt>{{Name}}</dt>
220 <dd> 219 <dd>
221 {{Description}} 220 {{Description}}
222 </dd>''' 221 </dd>'''
223 222
224 eventsListTemplate = \ 223 eventsListTemplate = '''
225 '''<h4>Events</h4> 224 <h4>Events</h4>
226 <dl> 225 <dl>
227 {{Events}} 226 {{Events}}
228 </dl>''' 227 </dl>'''
229 228
230 eventsListEntryTemplate = \ 229 eventsListEntryTemplate = '''
231 '''<dt>{{Name}}</dt> 230 <dt>{{Name}}</dt>
232 <dd> 231 <dd>
233 {{Description}} 232 {{Description}}
234 </dd>''' 233 </dd>'''
235 234
236 deprecatedTemplate = \ 235 deprecatedTemplate = '''
237 '''<p> 236 <p>
238 <b>Deprecated.</b> 237 <b>Deprecated.</b>
239 {{Lines}} 238 {{Lines}}
240 </p>''' 239 </p>'''
241 240
242 authorInfoTemplate = \ 241 authorInfoTemplate = '''
243 '''<p> 242 <p>
244 <i>Author(s)</i>: 243 <i>Author(s)</i>:
245 {{Authors}} 244 {{Authors}}
246 </p>''' 245 </p>'''
247 246
248 seeListTemplate = \ 247 seeListTemplate = '''
249 '''<dl> 248 <dl>
250 <dt><b>See Also:</b></dt> 249 <dt><b>See Also:</b></dt>
251 {{Links}} 250 {{Links}}
252 </dl>''' 251 </dl>'''
253 252
254 seeListEntryTemplate = \ 253 seeListEntryTemplate = '''
255 '''<dd> 254 <dd>
256 {{Link}} 255 {{Link}}
257 </dd>''' 256 </dd>'''
258 257
259 seeLinkTemplate = '''<a style="color:{LinkColor}" {{Link}}''' 258 seeLinkTemplate = '''<a style="color:{LinkColor}" {{Link}}'''
260 259
261 sinceInfoTemplate = \ 260 sinceInfoTemplate = '''
262 '''<p> 261 <p>
263 <b>since</b> {{Info}} 262 <b>since</b> {{Info}}
264 </p>''' 263 </p>'''
265 264
266 ################################# 265 #################################
267 ## Templates for index files ## 266 ## Templates for index files ##
286 Modules</h3> 285 Modules</h3>
287 <table> 286 <table>
288 {{Entries}} 287 {{Entries}}
289 </table>''' 288 </table>'''
290 289
291 indexListEntryTemplate = \ 290 indexListEntryTemplate = '''
292 '''<tr> 291 <tr>
293 <td><a style="color:{LinkColor}" href="{{Link}}">{{Name}}</a></td> 292 <td><a style="color:{LinkColor}" href="{{Link}}">{{Name}}</a></td>
294 <td>{{Description}}</td> 293 <td>{{Description}}</td>
295 </tr>''' 294 </tr>'''
296 295
297 # 296 #

eric ide

mercurial