Skip to content

Commit e513c17

Browse files
committed
DOC: Disable extra plot formats if not release mode
1 parent 481e2b2 commit e513c17

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
545557
def 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
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)