From 5cb2c630a4c6670533b7189165bf89a492b58e89 Mon Sep 17 00:00:00 2001 From: emmanuelle Date: Sat, 13 Dec 2014 13:31:36 +0100 Subject: [PATCH] Modified the order of API docs page so that table of contents is always at the top (following #880) --- doc/tools/apigen.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/tools/apigen.py b/doc/tools/apigen.py index f1a94b6a..375c70a3 100644 --- a/doc/tools/apigen.py +++ b/doc/tools/apigen.py @@ -279,6 +279,20 @@ class ApiDocWriter(object): ad += '\n.. automodule:: ' + uri + '\n' ad += '\n.. currentmodule:: ' + uri + '\n' + ad += '.. autosummary::\n\n' + for f in functions: + ad += ' ' + uri + '.' + f + '\n' + ad += '\n' + for c in classes: + ad += ' ' + uri + '.' + c + '\n' + ad += '\n' + + for f in functions: + # must NOT exclude from index to keep cross-refs working + full_f = uri + '.' + f + ad += f + '\n' + ad += self.rst_section_levels[2] * len(f) + '\n' + ad += '\n.. autofunction:: ' + full_f + '\n\n' for c in classes: ad += '\n:class:`' + c + '`\n' \ + self.rst_section_levels[2] * \ @@ -290,17 +304,6 @@ class ApiDocWriter(object): ' :show-inheritance:\n' \ '\n' \ ' .. automethod:: __init__\n' - ad += '.. autosummary::\n\n' - for f in functions: - ad += ' ' + uri + '.' + f + '\n' - ad += '\n' - - for f in functions: - # must NOT exclude from index to keep cross-refs working - full_f = uri + '.' + f - ad += f + '\n' - ad += self.rst_section_levels[2] * len(f) + '\n' - ad += '\n.. autofunction:: ' + full_f + '\n\n' return ad def _survives_exclude(self, matchstr, match_type):