From 301fa0a8fb873f5509fe20612336c50167875d07 Mon Sep 17 00:00:00 2001 From: Jens H Nielsen Date: Wed, 17 Sep 2014 22:03:34 +0100 Subject: [PATCH] Only insert links to pdfs if we are actually generating these. This should silence most warnings in the html only small build on travis --- lib/matplotlib/sphinxext/plot_directive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 08093fe2a7ec..8080f3de80c5 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -383,7 +383,9 @@ def remove_coding(text): {{ only_latex }} {% for img in images %} + {% if 'pdf' in img.formats -%} .. image:: {{ build_dir }}/{{ img.basename }}.pdf + {% endif -%} {% endfor %} {{ only_texinfo }}