Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(to_html): quarto_render() doesn't allow absolute paths for output anymore #73

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading