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/plot_directive.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/sphinxext/plot_directive.py') 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 = "" -- cgit v1.2.1