diff --git a/NEWS.md b/NEWS.md index 97494de8b9..9b64b175b5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ rmarkdown 2.27 ================================================================================ +- Provide a global option `rmarkdown.files.suffix` to configure the suffix of the directory for auxiliary files (thanks, @certara-tzweers, #2550). By default, this suffix is `_files`, which can cause HTML output files to be deleted automatically on Microsoft OneDrive or Google Drive. If that is the case for you, you may set a different suffix in your `.Rprofile`, e.g., `options(rmarkdown.files.suffix = "_rmdfiles")`. + rmarkdown 2.26 ================================================================================ diff --git a/R/util.R b/R/util.R index 5cac75155a..9d95e8e1b6 100644 --- a/R/util.R +++ b/R/util.R @@ -184,7 +184,8 @@ file_with_meta_ext <- function(file, meta_ext, ext = xfun::file_ext(file)) { } knitr_files_dir <- function(file) { - paste(xfun::sans_ext(file), "_files", sep = "") + suffix <- getOption("rmarkdown.files.suffix", "_files") + paste(xfun::sans_ext(file), suffix, sep = "") } knitr_root_cache_dir <- function(file) {