|
15 | 15 | #' @param output_format,...,clean,envir Arguments to be passed to |
16 | 16 | #' \code{rmarkdown::\link{render}()}. For \code{preview_chapter()}, \code{...} |
17 | 17 | #' is passed to \code{render_book()}. |
18 | | -#' @param clean_envir Whether to clean up the environment \code{envir} before |
19 | | -#' rendering the book. By default, the environment is cleaned when rendering |
20 | | -#' the book in a non-interactive R session. |
| 18 | +#' @param clean_envir This argument has been deprecated and will be removed in |
| 19 | +#' future versions of \pkg{bookdown}. |
21 | 20 | #' @param output_dir The output directory. If \code{NULL}, a field named |
22 | 21 | #' \code{output_dir} in the configuration file \file{_bookdown.yml} will be |
23 | 22 | #' used (possibly not specified, either, in which case a directory name |
@@ -51,15 +50,18 @@ render_book = function( |
51 | 50 | output_format = rmarkdown::all_output_formats(input) |
52 | 51 | } |
53 | 52 | if (length(output_format) > 1) { |
54 | | - return(unlist(lapply(output_format, function(fmt) render_book( |
| 53 | + return(unlist(lapply(output_format, function(fmt) xfun::Rscript_call(render_book, list( |
55 | 54 | input, fmt, ..., clean = clean, envir = envir, output_dir = output_dir, |
56 | 55 | new_session = new_session, preview = preview, config_file = config_file |
57 | | - )))) |
| 56 | + ))))) |
58 | 57 | } |
59 | 58 | format = target_format(output_format) |
60 | 59 | } |
61 | 60 |
|
62 | | - if (clean_envir) rm(list = ls(envir, all.names = TRUE), envir = envir) |
| 61 | + if (!missing(clean_envir)) warning( |
| 62 | + "The argument 'clean_envir' has been deprecated and will be removed in future ", |
| 63 | + "versions of bookdown." |
| 64 | + ) |
63 | 65 |
|
64 | 66 | if (config_file != '_bookdown.yml') { |
65 | 67 | unlink(tmp_config <- tempfile('_bookdown_', '.', '.yml')) |
|
0 commit comments