82
82
plot_include_source
83
83
Default value for the include-source option
84
84
85
+ plot_show_source_link
86
+ Whether to show a link to the source in HTML.
87
+
85
88
plot_pre_code
86
89
Code that should be executed before each plot.
87
90
@@ -304,6 +307,7 @@ def setup(app):
304
307
app .add_directive ('plot' , plot_directive , True , (0 , 2 , False ), ** options )
305
308
app .add_config_value ('plot_pre_code' , None , True )
306
309
app .add_config_value ('plot_include_source' , False , True )
310
+ app .add_config_value ('plot_show_source_link' , True , True )
307
311
app .add_config_value ('plot_formats' , ['png' , 'hires.png' , 'pdf' ], True )
308
312
app .add_config_value ('plot_basedir' , None , True )
309
313
app .add_config_value ('plot_html_show_formats' , True , True )
@@ -388,9 +392,9 @@ def remove_coding(text):
388
392
389
393
{{ only_html }}
390
394
391
- {% if source_link or (html_show_formats and not multi_image) %}
395
+ {% if ( source_link and show_source_link) or (html_show_formats and not multi_image) %}
392
396
(
393
- {%- if source_link -%}
397
+ {%- if source_link and show_source_link -%}
394
398
`Source code <{{ source_link }}>`__
395
399
{%- endif -%}
396
400
{%- if html_show_formats and not multi_image -%}
@@ -805,6 +809,7 @@ def run(arguments, content, options, state_machine, state, lineno):
805
809
dest_dir = dest_dir_link ,
806
810
build_dir = build_dir_link ,
807
811
source_link = src_link ,
812
+ show_source_link = config .plot_show_source_link ,
808
813
multi_image = len (images ) > 1 ,
809
814
only_html = only_html ,
810
815
only_latex = only_latex ,
0 commit comments