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

exclude renv folder from render_site() copied resources #1996

Merged
merged 5 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rmarkdown
Type: Package
Title: Dynamic Documents for R
Version: 2.6.0003
Version: 2.6.4
Authors@R: c(
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rmarkdown 2.7

- Add `output_format_filter` function to `default_site_generator()`. Enables custom site generators to customize or even entirely replace the output format right before rendering of each page.

- Automatically exclude renv directory for `render_site()` (thanks, @jmbuhr, #1996)

rmarkdown 2.6
================================================================================
Expand Down
9 changes: 5 additions & 4 deletions R/render_site.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
#' \item{Files beginning with "." (hidden files).}
#' \item{Files beginning with "_"}
#' \item{Files known to contain R source code (e.g. ".R", ".s", ".Rmd"), R
#' data (e.g. ".RData", ".rds"), or configuration data (e.g. ".Rproj",
#' "rsconnect")).}
#' data (e.g. ".RData", ".rds"), configuration data (e.g. ".Rproj",
#' "rsconnect") or package project management data (e.g.
#' "packrat", "renv").}
#' }
#' Note that you can override which files are included or excluded via
#' settings in "_site.yml" (described below).}
Expand Down Expand Up @@ -584,14 +585,14 @@ site_resources <- function(site_dir, include = NULL, exclude = NULL, recursive =
# excludes:
# - known source/data extensions
# - anything that starts w/ '.' or '_'
# - rsconnect and packrat directories
# - rsconnect, renv and packrat directories
# - user excludes
extensions <- c("R", "r", "S", "s",
"Rmd", "rmd", "md", "Rmarkdown", "rmarkdown",
"Rproj", "rproj",
"RData", "rdata", "rds")
extensions_regex <- utils::glob2rx(paste0("*.", extensions))
excludes <- c("^rsconnect$", "^packrat$", "^\\..*$", "^_.*$", "^.*_cache$",
excludes <- c("^rsconnect$", "^packrat$", "^renv$", "^\\..*$", "^_.*$", "^.*_cache$",
extensions_regex,
utils::glob2rx(exclude))
files <- all_files
Expand Down
5 changes: 3 additions & 2 deletions man/render_site.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.