From 02f5fd5ac8eeaa491ff6de9f6d531923542dba41 Mon Sep 17 00:00:00 2001 From: Jakob Koch Date: Wed, 5 Apr 2023 20:58:47 +0200 Subject: [PATCH] introduced a output_dir parameter, which sets the --ouput-dir flag, in order to produce correctly rendered .html output files. --- R/render.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/render.R b/R/render.R index abf6c84..6f62ec5 100644 --- a/R/render.R +++ b/R/render.R @@ -10,6 +10,9 @@ #' `"all"` will render all formats defined within the file or project. #' @param output_file The name of the output file. If using `NULL` then the #' output filename will be based on filename for the input file. +#' @param output_dir The output directory, this is necessary to set in order +#' to fix a rendering issue with .html files, where formating and +#' images were missing. Additionally a subdirectory of the yaml output directory can be detailed. #' @param execute Whether to execute embedded code chunks. #' @param execute_params A list of named parameters that override custom params #' specified within the YAML front-matter. @@ -54,6 +57,7 @@ quarto_render <- function(input = NULL, output_format = NULL, output_file = NULL, + output_dir = NULL, execute = TRUE, execute_params = NULL, execute_dir = NULL, @@ -108,6 +112,9 @@ quarto_render <- function(input = NULL, if (!missing(output_file)) { args <- c(args, "--output", output_file) } + if (!missing(output_dir)) { + args <- c(args, "--output-dir", output_dir) + } if (!missing(execute)) { args <- c(args, ifelse(isTRUE(execute), "--execute", "--no-execute")) }