Skip to content

Commit 36d18b0

Browse files
committed
Use R_QUARTO_QUIET instead to match quarto.quiet option name like in knitr
1 parent 63f916f commit 36d18b0

12 files changed

+33
-25
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ importFrom(rstudioapi,isAvailable)
4343
importFrom(rstudioapi,viewer)
4444
importFrom(tools,vignetteEngine)
4545
importFrom(utils,browseURL)
46+
importFrom(xfun,env_option)
4647
importFrom(yaml,as.yaml)
4748
importFrom(yaml,write_yaml)

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
- `quarto_path()` now correctly return `NULL` when no quarto is found in the PATH (thanks, @jeroen, #220, #221).
3333

34-
- `QUARTO_R_QUIET` environment variable can be used to set `quarto.quiet` option, which overrides any `quiet = TRUE` argument passed to `quarto_*` functions. This can be useful to debug Quarto rendering inside other packages, like **pkgdown**. Overrides will also now happens for [GHA debug logging](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging).
34+
- `R_QUARTO_QUIET` environment variable can be used to set `quarto.quiet` option, which overrides any `quiet = TRUE` argument passed to `quarto_*` functions. This can be useful to debug Quarto rendering inside other packages, like **pkgdown**. Overrides will also now happens for [GHA debug logging](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging).
3535

3636
- Correctly report Quarto CLI error when background process call to `quarto` fails (thanks, @salim-b, [#235](https://github.com/quarto-dev/quarto-r/issues/235))
3737

R/quarto-args.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ is_quiet <- function(quiet) {
1212
return(FALSE)
1313
}
1414
# these option takes precedence
15-
quiet_options <- getOption("quarto.quiet", Sys.getenv("QUARTO_R_QUIET", NA))
15+
quiet_options <- xfun::env_option("quarto.quiet", default = NA)
1616
if (!is.na(quiet_options)) {
1717
return(isTRUE(as.logical(quiet_options)))
1818
}

R/quarto-package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
#' @import rlang
66
#' @importFrom cli cli_inform
77
#' @importFrom tools vignetteEngine
8+
#' @importFrom xfun env_option
89
## usethis namespace: end
910
NULL

R/render.R

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#' @param quiet Suppress warning and other messages, from R and also Quarto CLI
4141
#' (i.e `--quiet` is passed as command line).
4242
#'
43-
#' `quarto.quiet` \R option or `QUARTO_R_QUIET` environment variable can be used to globally override a function call
43+
#' `quarto.quiet` \R option or `R_QUARTO_QUIET` environment variable can be used to globally override a function call
4444
#' (This can be useful to debug tool that calls `quarto_*` functions directly).
4545
#'
4646
#' On Github Actions, it will always be `quiet = FALSE`.
@@ -122,16 +122,22 @@ quarto_render <- function(
122122
script <- tempfile(fileext = ".R")
123123
render_args <- as.list(sys.call()[-1L])
124124
render_args <- mapply(
125-
function(arg, arg_name) paste0(
126-
arg_name,
127-
"="[nchar(arg_name) > 0L],
128-
deparse1(eval(arg, envir = parent.frame(n = 3L)))
129-
),
125+
function(arg, arg_name) {
126+
paste0(
127+
arg_name,
128+
"="[nchar(arg_name) > 0L],
129+
deparse1(eval(arg, envir = parent.frame(n = 3L)))
130+
)
131+
},
130132
render_args,
131133
names(render_args)
132134
)
133135
writeLines(
134-
paste0("quarto::quarto_render(", paste0(render_args, collapse = ", "), ")"),
136+
paste0(
137+
"quarto::quarto_render(",
138+
paste0(render_args, collapse = ", "),
139+
")"
140+
),
135141
script
136142
)
137143
rstudioapi::jobRunScript(

man/quarto_add_extension.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/quarto_create_project.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/quarto_inspect.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/quarto_remove_extension.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/quarto_render.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)