Skip to content

Commit

Permalink
provide an option to set the *_files/ directory suffix (#2550)
Browse files Browse the repository at this point in the history
Co-authored-by: Yihui Xie <[email protected]>
  • Loading branch information
certara-tzweers and yihui committed Apr 9, 2024
1 parent ee69d59 commit 835335d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
================================================================================
Expand Down
3 changes: 2 additions & 1 deletion R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 835335d

Please sign in to comment.