Skip to content

Commit ebd2c78

Browse files
committed
Merge pull request #1 from JonWaltman/texinfo
Add texinfo support to plot directive
2 parents 126d980 + 6449920 commit ebd2c78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,16 @@ def split_code_at_show(text):
394394
.. image:: {{ build_dir }}/{{ img.basename }}.pdf
395395
{% endfor %}
396396
397+
{{ only_texinfo }}
398+
399+
{% for img in images %}
400+
.. image:: {{ build_dir }}/{{ img.basename }}.png
401+
{%- for option in options %}
402+
{{ option }}
403+
{% endfor %}
404+
405+
{% endfor %}
406+
397407
"""
398408

399409
exception_template = """
@@ -726,6 +736,7 @@ def run(arguments, content, options, state_machine, state, lineno):
726736

727737
only_html = ".. only:: html"
728738
only_latex = ".. only:: latex"
739+
only_texinfo = ".. only:: texinfo"
729740

730741
if j == 0:
731742
src_link = source_link
@@ -740,6 +751,7 @@ def run(arguments, content, options, state_machine, state, lineno):
740751
multi_image=len(images) > 1,
741752
only_html=only_html,
742753
only_latex=only_latex,
754+
only_texinfo=only_texinfo,
743755
options=opts,
744756
images=images,
745757
source_code=source_code,

0 commit comments

Comments
 (0)