From c07aeb80c9baca1bd76fe55bab695bdb48242179 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Fri, 6 Oct 2023 10:43:23 -0400 Subject: [PATCH] fix(to_html): `quarto_render()` doesn't allow absolute paths for `output` anymore --- R/html.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/html.R b/R/html.R index 33b12e8..9345ad1 100644 --- a/R/html.R +++ b/R/html.R @@ -62,9 +62,13 @@ to_html <- function(from, to = NULL, self_contained = FALSE, render_args = NULL) withr::local_dir(fs::path_dir(input)) if (self_contained) { - render_args$output_file <- path_from( + # path_from() returns an absolute path + temp_output_file <- path_from( fs::path_file(render_args$output_file), "html", temporary = TRUE ) + # discard the path directory so that rmd/qmd is rendered into source dir + render_args$output_file <- fs::path_file(temp_output_file) + # and then move the output into the right place at the end withr::defer( fs::file_move(render_args$output_file, output_file), priority = "first"