Skip to content

Commit 9bfe3fd

Browse files
committed
Added ability to hide figures on the webpage
1 parent 9fdbae8 commit 9bfe3fd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

swiftpipeline/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class Script(object):
3333
section: str
3434
# Plot title; written above the caption
3535
title: str
36+
# Show on webpage; Defaults to True but used to disable webpage plotting
37+
# in the config file if required.
38+
show_on_webpage: bool
3639

3740
def __init__(self, script_dict: dict):
3841
"""
@@ -44,6 +47,7 @@ def __init__(self, script_dict: dict):
4447
self.output_file = script_dict.get("output_file", "")
4548
self.section = script_dict.get("section", "")
4649
self.title = script_dict.get("title", "")
50+
self.show_on_webpage = script_dict.get("show_on_webpage", True)
4751

4852
return
4953

swiftpipeline/html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def add_auto_plotter_metadata(self, auto_plotter_metadata: AutoPlotterMetadata):
136136
caption=plot.caption,
137137
)
138138
for plot in auto_plotter_metadata.metadata
139-
if plot.section == section
139+
if plot.section == section and plot.show_on_webpage
140140
]
141141

142142
self.variables["sections"].append(
@@ -170,7 +170,7 @@ def add_config_metadata(self, config: Config):
170170
caption=script.caption,
171171
)
172172
for script in config.scripts
173-
if script.section == section
173+
if script.section == section and script.show_on_webpage
174174
]
175175

176176
self.variables["sections"].append(

0 commit comments

Comments
 (0)