Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add texinfo support to plot_directive.py

  • Loading branch information...
commit 6449920c2bef179b1b92b818348ab48f0169e55b 1 parent 126d980
@JonWaltman JonWaltman authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/matplotlib/sphinxext/plot_directive.py
View
12 lib/matplotlib/sphinxext/plot_directive.py
@@ -394,6 +394,16 @@ def split_code_at_show(text):
.. image:: {{ build_dir }}/{{ img.basename }}.pdf
{% endfor %}
+{{ only_texinfo }}
+
+ {% for img in images %}
+ .. image:: {{ build_dir }}/{{ img.basename }}.png
+ {%- for option in options %}
+ {{ option }}
+ {% endfor %}
+
+ {% endfor %}
+
"""
exception_template = """
@@ -726,6 +736,7 @@ def run(arguments, content, options, state_machine, state, lineno):
only_html = ".. only:: html"
only_latex = ".. only:: latex"
+ only_texinfo = ".. only:: texinfo"
if j == 0:
src_link = source_link
@@ -740,6 +751,7 @@ def run(arguments, content, options, state_machine, state, lineno):
multi_image=len(images) > 1,
only_html=only_html,
only_latex=only_latex,
+ only_texinfo=only_texinfo,
options=opts,
images=images,
source_code=source_code,
Please sign in to comment.
Something went wrong with that request. Please try again.