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