diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-05-21 13:35:48 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-05-21 13:35:48 +0000 |
commit | b95b2b8c0575e7e43e8541f15b25160d62d0af18 (patch) | |
tree | 53ba1d27759dfed975229e347fdd2b716be9792d /doc/sphinxext/numpydoc.py | |
parent | e3377d609ae70ad2bbe312b983a41c8bcae8bd6b (diff) | |
download | numpy-b95b2b8c0575e7e43e8541f15b25160d62d0af18.tar.gz |
sphinxext/numpydoc: wrap Examples in plot:: if they contain matplotlib example code
Diffstat (limited to 'doc/sphinxext/numpydoc.py')
-rw-r--r-- | doc/sphinxext/numpydoc.py | 2 |
1 files changed, 2 insertions, 0 deletions
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) |