@@ -46,7 +46,7 @@ def add_parameter(name: str, value, param_list: list[str]) -> None:
46
46
report = snakemake .output .get ("report" , None )
47
47
48
48
49
- # Build params
49
+ # Build params to be passed to Quarto params (-P flag)
50
50
params = []
51
51
for name , value in snakemake .input .items ():
52
52
if name not in {"renv" , "script" }:
@@ -67,14 +67,23 @@ def add_parameter(name: str, value, param_list: list[str]) -> None:
67
67
68
68
with tempfile .TemporaryDirectory () as temp_output :
69
69
if report is None :
70
+ # In case no report output is specified,
71
+ # the output is created in a temporary folder
70
72
out_report = Path (temp_output ) / script .name
71
73
out_report_rendered = out_report
72
74
report_path = f"{ out_report } .tmp"
73
75
else :
76
+ # In case an output is specified,
77
+ # the output is created in the target folder.
74
78
report_path = Path (report ).resolve ()
79
+ # The report to-be-rendered is namespaced
80
+ # to prevent clashes.
75
81
out_report = (
76
- report_path .parent / f"{ report_path .stem } _temp_ { report_path .suffix [1 :]} .qmd"
82
+ report_path .parent / f"{ report_path .stem } _ { report_path .suffix [1 :]} .qmd"
77
83
)
84
+ # The rendered report is named as the final report with the correct suffix
85
+ # Note that in addition ot the target report file, also a folder `*_files/`
86
+ # is created, which contains the images and other files linked in the html report.
78
87
out_report_rendered = out_report .with_suffix (report_path .suffix )
79
88
if report_path .suffix == ".pdf" :
80
89
warnings .warn (
0 commit comments