From ea428c1bf0c8a8ae96f6e684f7f28213524645b3 Mon Sep 17 00:00:00 2001 From: jjcaballero Date: Wed, 3 Jul 2019 02:08:23 -0700 Subject: [PATCH 1/2] Added confluence as builder in plot_directive Signed-off-by: jjcaballero --- lib/matplotlib/sphinxext/plot_directive.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index caf9bb1cee14..98307b00104f 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -409,6 +409,16 @@ def split_code_at_show(text): {% endif -%} {% endfor %} +{{ only_confluence }} + + {% for img in images %} + .. image:: {{ build_dir }}/{{ img.basename }}.png + {% for option in options -%} + {{ option }} + {% endfor %} + + {% endfor %} + """ exception_template = """ @@ -780,6 +790,8 @@ def run(arguments, content, options, state_machine, state, lineno): only_html = ".. only:: html" only_latex = ".. only:: latex" only_texinfo = ".. only:: texinfo" + only_confluence = ".. only:: confluence" + # Not-None src_link signals the need for a source link in the generated # html @@ -797,6 +809,7 @@ def run(arguments, content, options, state_machine, state, lineno): only_html=only_html, only_latex=only_latex, only_texinfo=only_texinfo, + only_confluence=only_confluence, options=opts, images=images, source_code=source_code, From afa65c2a668d04b14185f747398a2dd5a51cc106 Mon Sep 17 00:00:00 2001 From: jjcaballero Date: Wed, 3 Jul 2019 03:33:02 -0700 Subject: [PATCH 2/2] removed unintentionally added blank line Signed-off-by: jjcaballero --- lib/matplotlib/sphinxext/plot_directive.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 98307b00104f..2837b46aae66 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -792,7 +792,6 @@ def run(arguments, content, options, state_machine, state, lineno): only_texinfo = ".. only:: texinfo" only_confluence = ".. only:: confluence" - # Not-None src_link signals the need for a source link in the generated # html if j == 0 and config.plot_html_show_source_link: