Skip to content

Commit 2691e59

Browse files
authored
put outputs to path
1 parent 4fcf29d commit 2691e59

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

quarto/render.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@
77

88
from quarto.quarto import find_quarto
99

10+
def render_to_path(input,
11+
output_format = None,
12+
output_file = None,
13+
execute = True,
14+
execute_params = None,
15+
execute_dir = None,
16+
cache = None,
17+
cache_refresh = False,
18+
kernel_keepalive = None,
19+
kernel_restart = False,
20+
debug = False,
21+
quiet = False,
22+
pandoc_args = None,
23+
output_dir_path=None):
24+
25+
render(input=input,
26+
output_format=output_format,
27+
output_file=output_file,
28+
execute=execute,
29+
execute_params=execute_params,
30+
execute_dir=execute_dir,
31+
cache=cache,
32+
cache_refresh=cache_refresh,
33+
kernel_keepalive=kernel_keepalive,
34+
kernel_restart=kernel_restart,
35+
debug=debug,
36+
quiet=quiet,
37+
pandoc_args=pandoc_args)
38+
39+
if output_dir_path is not None:
40+
output_file_path = os.path.join(output_folder, output_file)
41+
if output_file is None:
42+
output_file = os.path.basename(input)
43+
os.makedirs(output_dir_path, exist_ok=True)
44+
os.rename(output_file, output_file_path)
45+
46+
return output_file_path
47+
1048
def render(input,
1149
output_format = None,
1250
output_file = None,

0 commit comments

Comments
 (0)