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

verbose = !quiet #284

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
10 changes: 9 additions & 1 deletion R/render_docs.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @param parallel Logical. Render man pages and vignettes in parallel using the `future` framework. In addition to setting this argument to TRUE, users must define the parallelism plan in `future`. See the examples section below.
#' @param freeze Logical. If TRUE and a man page or vignette has not changed since the last call to `render_docs()`, that file is skipped. File hashes are stored in `altdoc/freeze.rds`. If that file is deleted, all man pages and vignettes will be rendered anew.
#' @param autolink Logical. TRUE to link function names and calls to web-based documentation. See the Autolink section below for details.
#' @param ... Additional arguments are ignored.
#' @inheritParams setup_docs
#' @export
#'
Expand Down Expand Up @@ -46,7 +47,14 @@
#' render_docs(parallel = TRUE)
#'
#' }
render_docs <- function(path = ".", verbose = FALSE, parallel = FALSE, freeze = FALSE, autolink = FALSE) {
render_docs <- function(path = ".", verbose = FALSE, parallel = FALSE, freeze = FALSE, autolink = FALSE, ...) {

# Quarto sometimes raises errors encouraging users to set `quiet=FALSE` to get more information.
# This is a convenience check to match Quarto's `quiet` and `altdoc`'s `verbose` arguments.
dots <- list(...)
if ("quiet" %in% names(dots) && is.logical(dots[["quiet"]]) && length(dots[["quiet"]]) == 1) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the length condition should be before the is.logical() to ensure we won't have an issue when is.logical() returns a vector of length > 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. But I think the proper fix is to have the length check in isTRUE(), because length() might not work at all or weirdly on objects of certain class.

verbose <- !dots[["quiet"]]
}

path <- .convert_path(path)
tool <- .doc_type(path)
Expand Down
5 changes: 4 additions & 1 deletion man/render_docs.Rd

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

Loading