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/plot_directive.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/plot_directive.py')
-rw-r--r-- | doc/sphinxext/plot_directive.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/sphinxext/plot_directive.py b/doc/sphinxext/plot_directive.py index b33da37e2..7b561c8fa 100644 --- a/doc/sphinxext/plot_directive.py +++ b/doc/sphinxext/plot_directive.py @@ -160,7 +160,7 @@ TEMPLATE = """ .. htmlonly:: {% if source_code %} - (`Source code <{{ source_link }}>`__) + (`Source code <{{ source_link }}>`__) .. admonition:: Output :class: plot-output @@ -293,9 +293,10 @@ def run(arguments, content, options, state_machine, state, lineno): if options['include-source']: if is_doctest: lines = [''] + lines += [row.rstrip() for row in code.split('\n')] else: lines = ['.. code-block:: python', ''] - lines += [' %s' % row.rstrip() for row in code.split('\n')] + lines += [' %s' % row.rstrip() for row in code.split('\n')] source_code = "\n".join(lines) else: source_code = "" |