Skip to content

Commit

Permalink
Merge pull request #73 from jhelvy/fix/quarto-render-update
Browse files Browse the repository at this point in the history
fix(to_html): `quarto_render()` doesn't allow absolute paths for `output` anymore
  • Loading branch information
jhelvy authored Oct 6, 2023
2 parents 2b7138a + c07aeb8 commit b7223e1
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 b7223e1

Please sign in to comment.