Skip to content

Commit

Permalink
fix(to_html): quarto_render() doesn't allow absolute paths for `out…
Browse files Browse the repository at this point in the history
…put` anymore
  • Loading branch information
gadenbuie committed Oct 6, 2023
1 parent 2b7138a commit c07aeb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/html.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c07aeb8

Please sign in to comment.