File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -542,13 +542,28 @@ def _check_dependencies():
542542# graphviz_output_format = 'svg'
543543
544544
545+ def reduce_plot_formats (app ):
546+ if app .builder .name == 'html' :
547+ keep = 'png'
548+ elif app .builder .name == 'latex' :
549+ keep = 'pdf'
550+ else :
551+ return
552+ app .config .plot_formats = [entry
553+ for entry in app .config .plot_formats
554+ if entry [0 ] == keep ]
555+
556+
545557def setup (app ):
546558 if any (st in version for st in ('post' , 'alpha' , 'beta' )):
547559 bld_type = 'dev'
548560 else :
549561 bld_type = 'rel'
550562 app .add_config_value ('releaselevel' , bld_type , 'env' )
551563
564+ if not _doc_release_mode :
565+ app .connect ('builder-inited' , reduce_plot_formats )
566+
552567# -----------------------------------------------------------------------------
553568# Source code links
554569# -----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments