From 7b7e2f1f1995d7dd5a6758cd6293bbce2ae720f0 2013-11-14 23:12:21 From: Thomas Kluyver Date: 2013-11-14 23:12:21 Subject: [PATCH] Use Sphinx autosummary extension for API docs index --- diff --git a/docs/source/conf.py b/docs/source/conf.py index 448dad8..d6fc28d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -44,6 +44,7 @@ extensions = [ 'matplotlib.sphinxext.only_directives', 'matplotlib.sphinxext.plot_directive', 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.inheritance_diagram', 'sphinx.ext.intersphinx', diff --git a/docs/sphinxext/apigen.py b/docs/sphinxext/apigen.py index 6cfc2ce..21f28e2 100644 --- a/docs/sphinxext/apigen.py +++ b/docs/sphinxext/apigen.py @@ -415,7 +415,8 @@ class ApiDocWriter(object): idx = open(path,'wt') w = idx.write w('.. AUTO-GENERATED FILE -- DO NOT EDIT!\n\n') - w('.. toctree::\n\n') - for f in self.written_modules: - w(' %s\n' % os.path.join(relpath,f)) + w('.. autosummary::\n' + ' :toctree: %s\n\n' % relpath) + for mod in self.written_modules: + w(' %s\n' % mod) idx.close()