Show More
@@ -221,30 +221,24 b' class ApiDocWriter(object):' | |||
|
221 | 221 | |
|
222 | 222 | ad += '\n.. automodule:: ' + uri + '\n' |
|
223 | 223 | ad += '\n.. currentmodule:: ' + uri + '\n' |
|
224 | multi_class = len(classes) > 1 | |
|
225 | multi_fx = len(functions) > 1 | |
|
226 | if multi_class: | |
|
227 |
ad += '\n' |
|
|
228 |
self.rst_section_levels[2] * |
|
|
229 | elif len(classes) and multi_fx: | |
|
230 | ad += '\n' + 'Class' + '\n' + \ | |
|
231 | self.rst_section_levels[2] * 5 + '\n' | |
|
224 | ||
|
225 | if classes: | |
|
226 | subhead = str(len(classes)) + (' Classes' if len(classes) > 1 else ' Class') | |
|
227 | ad += '\n'+ subhead + '\n' + \ | |
|
228 | self.rst_section_levels[2] * len(subhead) + '\n' | |
|
229 | ||
|
232 | 230 | for c in classes: |
|
233 | ad += '\n:class:`' + c.name + '`\n' \ | |
|
234 | + self.rst_section_levels[multi_class + 2 ] * \ | |
|
235 | (len(c.name)+9) + '\n\n' | |
|
236 | 231 | ad += '\n.. autoclass:: ' + c.name + '\n' |
|
237 | 232 | # must NOT exclude from index to keep cross-refs working |
|
238 | 233 | ad += ' :members:\n' \ |
|
239 | 234 | ' :show-inheritance:\n' |
|
240 | 235 | if c.has_init: |
|
241 | 236 | ad += '\n .. automethod:: __init__\n' |
|
242 | if multi_fx: | |
|
243 | ad += '\n' + 'Functions' + '\n' + \ | |
|
244 | self.rst_section_levels[2] * 9 + '\n\n' | |
|
245 | elif len(functions) and multi_class: | |
|
246 | ad += '\n' + 'Function' + '\n' + \ | |
|
247 | self.rst_section_levels[2] * 8 + '\n\n' | |
|
237 | ||
|
238 | if functions: | |
|
239 | subhead = str(len(functions)) + (' Functions' if len(functions) > 1 else ' Function') | |
|
240 | ad += '\n'+ subhead + '\n' + \ | |
|
241 | self.rst_section_levels[2] * len(subhead) + '\n' | |
|
248 | 242 | for f in functions: |
|
249 | 243 | # must NOT exclude from index to keep cross-refs working |
|
250 | 244 | ad += '\n.. autofunction:: ' + uri + '.' + f + '\n\n' |
General Comments 0
You need to be logged in to leave comments.
Login now