[Numpy-discussion] [Nipy-devel] Sphinx custom extension mess, and patches

Fernando Perez fperez.net@gmail....
Fri Feb 20 19:02:45 CST 2009


On Mon, Feb 16, 2009 at 3:21 PM, Gael Varoquaux
<gael.varoquaux@normalesup.org> wrote:

> I am not blaming anyone, just pointing out a non ideal situation. It has
> already improved a lot with the matplotlib guys and the scipy guys
> merging some changes in extensions and publishing the extensions in an
> importable part of their source tree.

In keeping with the spirit of trying to get all of these extension
changes upstream so that we can all eventually stop carrying our own
copies, below is a tiny change I just made to the inheritance diagram
one.  This is needed to ensure that the figure is separated from any
surrounding text, since otherwise you get hideous off-screen diagrams
in the rendered PDF.

This has been committed to the nipy trunk already.

Similarly (for the pymvpa crowd), the api autogen code is now a
module, and it also contains a few small fixes, in particular
regarding chapter titles.  Feel free to grab and update your copy:

http://bazaar.launchpad.net/~nipy-developers/nipy/trunk/annotate/head%3A/tools/apigen.py

I've been told the gods of numpy/sphinx don't like auto-generated
docs, but I think there's a valid use case for these tools, so
hopefully in the future it will be possible to include them upstream
for us lesser mortals to use.  If not, I guess we'll just continue to
carry our copies around :)

Cheers,

f

# diff, inline because it's so trivial:

=== modified file 'doc/sphinxext/inheritance_diagram.py'
--- doc/sphinxext/inheritance_diagram.py	2009-01-30 02:00:57 +0000
+++ doc/sphinxext/inheritance_diagram.py	2009-02-20 21:11:38 +0000
@@ -370,7 +370,7 @@

     graph.run_dot(['-Tpdf', '-o%s' % pdf_path],
                   name, parts, graph_options={'size': '"6.0,6.0"'})
-    return '\\includegraphics{%s}' % pdf_path
+    return '\n\\includegraphics{%s}\n\n' % pdf_path

 def visit_inheritance_diagram(inner_func):
     """


More information about the Numpy-discussion mailing list