From b95b2b8c0575e7e43e8541f15b25160d62d0af18 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 21 May 2009 13:35:48 +0000 Subject: sphinxext/numpydoc: wrap Examples in plot:: if they contain matplotlib example code --- doc/sphinxext/numpydoc.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/sphinxext/numpydoc.py') diff --git a/doc/sphinxext/numpydoc.py b/doc/sphinxext/numpydoc.py index edd58597f..846dd7b85 100644 --- a/doc/sphinxext/numpydoc.py +++ b/doc/sphinxext/numpydoc.py @@ -30,6 +30,7 @@ def mangle_docstrings(app, what, name, obj, options, lines, lines[:] = title_re.sub('', "\n".join(lines)).split("\n") else: doc = get_doc_object(obj, what, "\n".join(lines)) + doc.use_plots = app.config.numpydoc_use_plots lines[:] = str(doc).split("\n") if app.config.numpydoc_edit_link and hasattr(obj, '__name__') and \ @@ -93,6 +94,7 @@ def setup(app, get_doc_object_=get_doc_object): app.connect('autodoc-process-docstring', mangle_docstrings) app.connect('builder-inited', initialize) app.add_config_value('numpydoc_edit_link', None, True) + app.add_config_value('numpydoc_use_plots', None, False) #------------------------------------------------------------------------------ # Monkeypatch sphinx.ext.autodoc to accept argspecless autodocs (Sphinx < 0.5) -- cgit v1.2.1