From 6b1e54bb06f6b93291044ffa5c48e9b97c7cc93a Mon Sep 17 00:00:00 2001 From: awunderground Date: Mon, 26 Jun 2023 14:16:33 -0400 Subject: [PATCH] Tidy up render documentation --- R/quarto_render_wrapper.R | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/R/quarto_render_wrapper.R b/R/quarto_render_wrapper.R index 9dce3b9..e6e7e93 100644 --- a/R/quarto_render_wrapper.R +++ b/R/quarto_render_wrapper.R @@ -16,12 +16,7 @@ quarto_render_wrapper <- function(input, output_file, execute_params, dir_name) { - # we must render the pages in the top-level directory because of changes to - # quarto - # we render all files in the top-level directory and then copy the needed - # files to the destination directory - # delete directory and contents if it exists - + # delete the directory if it exists if (dir.exists(dir_name)) { unlink(dir_name, recursive = TRUE) @@ -66,6 +61,8 @@ quarto_render_wrapper <- function(input, output_file, execute_params, dir_name) to = paste0(dir_name, "_quarto.yml") ) + # render the quarto document in the new directory + # rendering in the top level directory and then copying does not work xfun::in_dir( dir = dir_name, expr = quarto_render( @@ -75,9 +72,10 @@ quarto_render_wrapper <- function(input, output_file, execute_params, dir_name) ) ) + # delete extra files + file.remove(paste0(dir_name, "search.json")) file.remove(paste0(dir_name, "index.qmd")) - }