diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 2f6189fce..030dab9c2 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -19,6 +19,7 @@ jobs: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_CLI_NUM_COLORS: 256 steps: - uses: actions/checkout@v3 @@ -37,8 +38,12 @@ jobs: needs: website - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + run: | + rmarkdown::render("README.Rmd") + pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} + env: + IN_PKGDOWN: true - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 000000000..fe5a1822d --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,72 @@ +# R-hub's genetic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/rhub2/blob/v1/inst/workflow/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub2::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/rhub2/actions/rhub-setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: actions/checkout@v3 + - uses: r-hub/rhub2/actions/rhub-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: actions/checkout@v3 + - uses: r-hub/rhub2/actions/rhub-setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/rhub2/actions/rhub-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index 993d6ea3d..e1fdfc515 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: cli Title: Helpers for Developing Command Line Interfaces -Version: 3.6.0.9000 +Version: 3.6.1.9000 Authors@R: c( person("Gábor", "Csárdi", , "csardi.gabor@gmail.com", role = c("aut", "cre")), person("Hadley", "Wickham", role = "ctb"), @@ -57,4 +57,4 @@ Config/Needs/website: vctrs Config/testthat/edition: 3 Encoding: UTF-8 -RoxygenNote: 7.2.1.9000 +RoxygenNote: 7.2.3 diff --git a/NEWS.md b/NEWS.md index 94d54ffa5..8dfcfb3b9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,10 @@ * `ansi_collapse(x, trunc = 1, style = "head")` now indeed show one element if `length(x) == 2`, as documented (@salim-b, #572). +# cli 3.6.1 + +* ANSI hyperlinks are now turned off on the RStudio render plane (#581). + # cli 3.6.0 * The progressr progress handler now reports progress correctly diff --git a/R/aab-rstudio-detect.R b/R/aab-rstudio-detect.R index 507e8bb4e..8942089c3 100644 --- a/R/aab-rstudio-detect.R +++ b/R/aab-rstudio-detect.R @@ -275,7 +275,7 @@ rstudio <- local({ ansi_tty = FALSE, ansi_color = FALSE, num_colors = 1L, - hyperlink = data$envs[["RSTUDIO_CLI_HYPERLINKS"]] != "", + hyperlink = FALSE, has_canonical_mode = FALSE ) } diff --git a/R/ansi-hyperlink.R b/R/ansi-hyperlink.R index e8b4ae6a3..1a5035705 100644 --- a/R/ansi-hyperlink.R +++ b/R/ansi-hyperlink.R @@ -327,17 +327,7 @@ ansi_has_hyperlink_support <- function() { if (isTRUE(as.logical(enabled))){ return(TRUE) } ## If ANSI support is off, then this is off as well - opt <- as.integer(getOption("cli.num_colors", NULL))[1] - if (!is.na(opt) && opt == 1) return(FALSE) - env <- as.integer(Sys.getenv("R_CLI_NUM_COLORS", ""))[1] - if (!is.na(env) && env == 1) return(FALSE) - cray_opt <- as.logical(getOption("crayon.enabled", NULL))[1] - if (!is.na(cray_opt) && !cray_opt) return(FALSE) - if (!is.na(Sys.getenv("NO_COLOR", NA_character_))) return(FALSE) - - ## environment variable used by RStudio - enabled <- Sys.getenv("RSTUDIO_CLI_HYPERLINKS", "") - if (isTRUE(as.logical(enabled))){ return(TRUE) } + if (num_ansi_colors() == 1) return(FALSE) ## Are we in RStudio? rstudio <- rstudio_detect() diff --git a/R/bullets.R b/R/bullets.R index 5d241e878..100db4f58 100644 --- a/R/bullets.R +++ b/R/bullets.R @@ -46,6 +46,8 @@ #' @param class Optional additional class(es) for the `div.bullets` element. #' @param .envir Environment to evaluate the glue expressions in. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_bullets <- function(text, id = NULL, class = NULL, @@ -75,7 +77,9 @@ cli_bullets <- function(text, id = NULL, class = NULL, #' @param id Optional id of the `div.bullets` element, can be used in themes. #' @param class Optional additional class(es) for the `div.bullets` element. #' +#' @seealso These functions support [inline markup][inline-markup]. #' @seealso See [cli_bullets()] for examples. +#' @family functions supporting inline markup #' @export cli_bullets_raw <- function(text, id = NULL, class = NULL) { diff --git a/R/cli.R b/R/cli.R index 24c26743a..bffc22666 100644 --- a/R/cli.R +++ b/R/cli.R @@ -106,6 +106,8 @@ cli_fmt <- function(expr, collapse = FALSE, strip_newline = FALSE) { #' and form feeds) as is in the input. #' @return Character scalar, the formatted string. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export #' @examples #' format_inline("A message for {.emph later}, thanks {.fn format_inline}.") @@ -199,6 +201,8 @@ format_inline <- function(..., .envir = parent.frame(), collapse = TRUE, #' concatenated into a single string. Newlines are _not_ preserved. #' @param .envir Environment to evaluate the glue expressions in. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_text <- function(..., .envir = parent.frame()) { @@ -266,6 +270,8 @@ cli_verbatim <- function(..., .envir = parent.frame()) { #' themes. #' @param .envir Environment to evaluate the glue expressions in. #' +#' @seealso These functions supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_h1 <- function(text, id = NULL, class = NULL, .envir = parent.frame()) { @@ -490,6 +496,8 @@ cli_end <- function(id = NULL) { #' @inheritParams cli_div #' @return The id of the new container element, invisibly. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export @@ -555,6 +563,8 @@ cli_ul <- function(items = NULL, id = NULL, class = NULL, #' @inheritParams cli_ul #' @return The id of the new container element, invisibly. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_ol <- function(items = NULL, id = NULL, class = NULL, @@ -605,6 +615,8 @@ cli_ol <- function(items = NULL, id = NULL, class = NULL, #' @inheritParams cli_ul #' @return The id of the new container element, invisibly. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_dl <- function(items = NULL, labels = names(items), id = NULL, @@ -658,6 +670,8 @@ cli_dl <- function(items = NULL, labels = names(items), id = NULL, #' @inheritParams cli_div #' @return The id of the new container element, invisibly. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_li <- function(items = NULL, labels = names(items), id = NULL, @@ -725,6 +739,8 @@ cli_li <- function(items = NULL, labels = names(items), id = NULL, #' @param wrap Whether to auto-wrap the text of the alert. #' @param .envir Environment to evaluate the glue expressions in. #' +#' @seealso These functions supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_alert <- function(text, id = NULL, class = NULL, wrap = FALSE, @@ -840,6 +856,8 @@ cli_alert_info <- function(text, id = NULL, class = NULL, wrap = FALSE, #' @inheritParams rule #' @inheritParams cli_div #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_rule <- function(left = "", center = "", right = "", id = NULL, @@ -865,11 +883,14 @@ cli_rule <- function(left = "", center = "", right = "", id = NULL, #' cli_blockquote(evil, citation = "Donald Ervin Knuth") #' ``` #' -#' @export #' @param quote Text of the quotation. #' @param citation Source of the quotation, typically a link or the name #' of a person. #' @inheritParams cli_div +#' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family functions supporting inline markup +#' @export cli_blockquote <- function(quote, citation = NULL, id = NULL, class = NULL, .envir = parent.frame()) { diff --git a/R/cliapp-docs.R b/R/cliapp-docs.R index cb863ffb1..87aae6407 100644 --- a/R/cliapp-docs.R +++ b/R/cliapp-docs.R @@ -1,5 +1,9 @@ -#' About inline markup in the semantic cli +#' @title About inline markup in the semantic cli +#' +#' @description +#' To learn how to use cli’s semantic markup, start with the ‘Building +#' a semantic CLI’ article at . #' #' @section Command substitution: #' @@ -46,26 +50,26 @@ #' * `email` for an email address. #' If the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), #' then cli creates a clickable link. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `emph` for emphasized text. #' * `envvar` for the name of an environment variable. #' * `field` for a generic field, e.g. in a named list. #' * `file` for a file name. If the terminal supports ANSI hyperlinks (e.g. #' RStudio, iTerm2, etc.), then cli creates a clickable link that opens #' the file in RStudio or with the default app for the file type. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `fun` for a function name. If it is in the `package::function_name` #' form, and the terminal supports ANSI hyperlinks (e.g. RStudio, #' iTerm2, etc.), then cli creates a clickable link. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `help` is a help page of a _function_. #' If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio), #' then cli creates a clickable link. It supports link text. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `href` creates a hyperlink, potentially with a link text. #' If the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), #' then cli creates a clickable link. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `key` for a keyboard key. #' * `obj_type_friendly` formats the type of an R object in a readable way, #' and it should be used with `{}`, see an example below. @@ -75,23 +79,23 @@ #' * `pkg` for a package name. #' * `run` is an R expression, that is potentially clickable if the terminal #' supports ANSI hyperlinks to runnable code (e.g. RStudio). -#' It supports link text. See [links] for more about cli hyperlinks. -#' * `strong` for strong importance. -#' * `topic` is a help page of a _ropic_. +#' It supports link text. See [links] for more information about cli hyperlinks. +#' * `str` for a double quoted string escaped by [base::encodeString()].#' * `strong` for strong importance. +#' * `topic` is a help page of a _topic_. #' If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio), #' then cli creates a clickable link. It supports link text. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `type` formats the type of an R object in a readable way, and it #' should be used with `{}`, see an example below. #' * `url` for a URL. If the terminal supports ANSI hyperlinks (e.g. #' RStudio, iTerm2, etc.), then cli creates a clickable link. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' * `var` for a variable name. #' * `val` for a generic "value". #' * `vignette` is a vignette. #' If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio), #' then cli creates a clickable link. It supports link text. -#' See [links] for more about cli hyperlinks. +#' See [links] for more information about cli hyperlinks. #' #' ```{asciicast inline-examples} #' ul <- cli_ul() @@ -198,7 +202,8 @@ #' ```{asciicast inline-plural} #' ndirs <- 1 #' nfiles <- 13 -#' cli_alert_info("Found {ndirs} diretor{?y/ies} and {nfiles} file{?s}.") +#' pkgs <- c("pkg1", "pkg2", "pkg3") +#' cli_alert_info("Found {ndirs} director{?y/ies} and {nfiles} file{?s}.") #' cli_text("Will install {length(pkgs)} package{?s}: {.pkg {pkgs}}") #' ``` #' @@ -612,7 +617,7 @@ NULL #' To link to a help topic that is not a function, use `.topic`: #' #' ```{asciicast links-topic} -#' cli::cli_text("... the tibble options at {.help tibble::tibble_options}.") +#' cli::cli_text("... the tibble options at {.topic tibble::tibble_options}.") #' ``` #' #' `.topic` support link text. @@ -650,7 +655,7 @@ NULL #' #' ## Security considerations #' -#' To make `.run` hyperlinks more secure, RStudio with not run code +#' To make `.run` hyperlinks more secure, RStudio will not run code #' #' * that is not in the `pkg::fun(args)` form, #' * if `args` contains `(`, `)` or `;`, @@ -658,5 +663,10 @@ NULL #' * if it calls a package that is not loaded, and it is not one of #' testthat, devtools, usethis, or rlang, which are explicitly allowed. #' +#' When RStudio does not run a `.run` hyperlink, then it shows the code +#' and the user can copy and paste it to the console, if they consider +#' it safe to run. +#' +#' Note that depending on your version of RStudio, the behavior can change. #' @name links NULL diff --git a/R/diff.R b/R/diff.R index a7bb48a14..7a74cfa31 100644 --- a/R/diff.R +++ b/R/diff.R @@ -167,7 +167,7 @@ get_diff_chunks <- function(lcs, context = 3L) { # chunk starts at operation number sum(length) before it, plus 1, but # at the end we change this to include the context chunks are well - chunks$op_begin <- c(0, cumsum(runs$length))[which(runs$values)] + 1 + chunks$op_begin <- c(0, cumsum(runs$lengths))[which(runs$values)] + 1 chunks$op_length <- runs$lengths[runs$values] # `old` positions are from `old_off`, but need to fix the boundaries diff --git a/R/errors.R b/R/errors.R index be487ff1b..c387db412 100644 --- a/R/errors.R +++ b/R/errors.R @@ -139,6 +139,26 @@ # * Use a `procsrcref` column for processed source references. # Otherwise testthat (and probably other rlang based packages), will # pick up the `srcref` column, and they expect an `srcref` object there. +# +# ### 3.1.0 -- 2022-10-04 +# +# * Add ANSI hyperlinks to stack traces, if we have a recent enough +# cli package that supports this. +# +# ### 3.1.1 -- 2022-11-17 +# +# * Use `[[` instead of `$` to fix some partial matches. +# * Use fully qualified `base::stop()` to enable overriding `stop()` +# in a package. (Makes sense if compat files use `stop()`. +# * The `is_interactive()` function is now exported. +# +# ### 3.1.2 -- 2022-11-18 +# +# * The `parent` condition can now be an interrupt. +# +# ### 3.1.3 -- 2023-01-15 +# +# * Now we do not load packages when walking the trace. err <- local({ @@ -212,10 +232,10 @@ err <- local({ throw(new_error("Parent condition must be a condition object")) } - if (isTRUE(cond$call)) { - cond$call <- sys.call(-1) %||% sys.call() - } else if (identical(cond$call, FALSE)) { - cond$call <- NULL + if (isTRUE(cond[["call"]])) { + cond[["call"]] <- sys.call(-1) %||% sys.call() + } else if (identical(cond[["call"]], FALSE)) { + cond[["call"]] <- NULL } cond <- process_call(cond) @@ -294,7 +314,7 @@ err <- local({ opts <- options(show.error.messages = FALSE) on.exit(options(opts), add = TRUE) - stop(cond) + base::stop(cond) } # -- rethrow with parent ----------------------------------------------- @@ -350,7 +370,7 @@ err <- local({ .hide_from_trace <- 0:1 e$srcref <- srcref e$procsrcref <- NULL - e$call <- call + e[["call"]] <- call name <- native_name(.NAME) err <- new_error("Native call to `", name, "` failed", call. = call1) cerror <- if (inherits(e, "simpleError")) "c_error" @@ -385,7 +405,7 @@ err <- local({ .hide_from_trace <- 0:1 e$srcref <- srcref e$procsrcref <- NULL - e$call <- call + e[["call"]] <- call name <- native_name(.NAME) err <- new_error("Native call to `", name, "` failed", call. = call1) cerror <- if (inherits(e, "simpleError")) "c_error" @@ -531,6 +551,7 @@ err <- local({ if (ns == "base") return("::") if (! ns %in% loadedNamespaces()) return("") name <- call_name(call) + if (! ns %in% loadedNamespaces()) return("::") nsenv <- asNamespace(ns)$.__NAMESPACE__. if (is.null(nsenv)) return("::") if (is.null(nsenv$exports)) return(":::") @@ -558,7 +579,7 @@ err <- local({ procsrcref = procsrcrefs, pid = pids ) - trace$call <- calls + trace[["call"]] <- calls class(trace) <- c("rlib_trace_3_0", "rlib_trace", "tbl", "data.frame") trace @@ -691,12 +712,20 @@ err <- local({ # -- condition message with cli --------------------------------------- + cnd_message_robust <- function(cond) { + class(cond) <- setdiff(class(cond), "rlib_error_3_0") + conditionMessage(cond) %||% + (if (inherits(cond, "interrupt")) "interrupt") %||% + "" + } + cnd_message_cli <- function(cond, full = FALSE) { exp <- paste0(cli::col_yellow("!"), " ") add_exp <- is.null(names(cond$message)) + msg <- cnd_message_robust(cond) c( - paste0(if (add_exp) exp, cond$message), + paste0(if (add_exp) exp, msg), if (inherits(cond$parent, "condition")) { msg <- if (full && inherits(cond$parent, "rlib_error_3_0")) { format(cond$parent, @@ -706,6 +735,8 @@ err <- local({ header = FALSE, advice = FALSE ) + } else if (inherits(cond$parent, "interrupt")) { + "interrupt" } else { conditionMessage(cond$parent) } @@ -724,7 +755,7 @@ err <- local({ exp <- "! " add_exp <- is.null(names(cond$message)) c( - paste0(if (add_exp) exp, cond$message), + paste0(if (add_exp) exp, cnd_message_robust(cond)), if (inherits(cond$parent, "condition")) { msg <- if (full && inherits(cond$parent, "rlib_error_3_0")) { format(cond$parent, @@ -734,6 +765,8 @@ err <- local({ header = FALSE, advice = FALSE ) + } else if (inherits(cond$parent, "interrupt")) { + "interrupt" } else { conditionMessage(cond$parent) } @@ -777,7 +810,7 @@ err <- local({ format_header_line_cli <- function(x, prefix = NULL) { p_error <- format_error_heading_cli(x, prefix) - p_call <- format_call_cli(x$call) + p_call <- format_call_cli(x[["call"]]) p_srcref <- format_srcref_cli(conditionCall(x), x$procsrcref %||% x$srcref) paste0(p_error, p_call, p_srcref, if (!is.null(conditionCall(x))) ":") } @@ -859,11 +892,11 @@ err <- local({ srcref <- if ("srcref" %in% names(x) || "procsrcref" %in% names(x)) { vapply( seq_len(nrow(x)), - function(i) format_srcref_cli(x$call[[i]], x$procsrcref[[i]] %||% x$srcref[[i]]), + function(i) format_srcref_cli(x[["call"]][[i]], x$procsrcref[[i]] %||% x$srcref[[i]]), character(1) ) } else { - unname(vapply(x$call, format_srcref_cli, character(1))) + unname(vapply(x[["call"]], format_srcref_cli, character(1))) } lines <- paste0( @@ -885,7 +918,10 @@ err <- local({ } format_trace_call_cli <- function(call, ns = "") { - envir <- tryCatch(asNamespace(ns), error = function(e) .GlobalEnv) + envir <- tryCatch({ + if (!ns %in% loadedNamespaces()) stop("no") + asNamespace(ns) + }, error = function(e) .GlobalEnv) cl <- trimws(format(call)) if (length(cl) > 1) { cl <- paste0(cl[1], " ", cli::symbol$ellipsis) } # Older cli does not have 'envir'. @@ -935,18 +971,18 @@ err <- local({ srcref <- if ("srcref" %in% names(x) || "procsrfref" %in% names(x)) { vapply( seq_len(nrow(x)), - function(i) format_srcref_plain(x$call[[i]], x$procsrcref[[i]] %||% x$srcref[[i]]), + function(i) format_srcref_plain(x[["call"]][[i]], x$procsrcref[[i]] %||% x$srcref[[i]]), character(1) ) } else { - unname(vapply(x$call, format_srcref_plain, character(1))) + unname(vapply(x[["call"]], format_srcref_plain, character(1))) } lines <- paste0( paste0(format(x$num), ". "), ifelse (visible, "", "| "), scope, - vapply(x$call, format_trace_call_plain, character(1)), + vapply(x[["call"]], format_trace_call_plain, character(1)), srcref ) @@ -959,7 +995,7 @@ err <- local({ format_header_line_plain <- function(x, prefix = NULL) { p_error <- format_error_heading_plain(x, prefix) - p_call <- format_call_plain(x$call) + p_call <- format_call_plain(x[["call"]]) p_srcref <- format_srcref_plain(conditionCall(x), x$procsrcref %||% x$srcref) paste0(p_error, p_call, p_srcref, if (!is.null(conditionCall(x))) ":") } @@ -1026,15 +1062,15 @@ err <- local({ process_call <- function(cond) { cond[c("call", "srcref", "procsrcref")] <- list( - call = if (is.null(cond$call)) { + call = if (is.null(cond[["call"]])) { NULL - } else if (is.character(cond$call)) { - cond$call + } else if (is.character(cond[["call"]])) { + cond[["call"]] } else { - deparse(cond$call, nlines = 2) + deparse(cond[["call"]], nlines = 2) }, srcref = NULL, - procsrcref = get_srcref(cond$call, cond$procsrcref %||% cond$srcref) + procsrcref = get_srcref(cond[["call"]], cond$procsrcref %||% cond$srcref) ) cond } @@ -1139,6 +1175,7 @@ err <- local({ add_trace_back = add_trace_back, process_call = process_call, onload_hook = onload_hook, + is_interactive = is_interactive, format = list( advice = format_advice, call = format_call, diff --git a/R/format-conditions.R b/R/format-conditions.R index 7e9110c25..772f40d51 100644 --- a/R/format-conditions.R +++ b/R/format-conditions.R @@ -27,6 +27,8 @@ #' @param message It is formatted via a call to [cli_bullets()]. #' @param .envir Environment to evaluate the glue expressions in. #' +#' @seealso These functions support [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export format_error <- function(message, .envir = parent.frame()) { diff --git a/R/glue.R b/R/glue.R index 64f90a18c..ec6a51cc5 100644 --- a/R/glue.R +++ b/R/glue.R @@ -15,7 +15,7 @@ glue <- function(text, .envir = parent.frame(), text <- paste0(text, collapse = "") - if (length(text) < 1) { + if (length(text) < 1L) { return(text) } @@ -34,8 +34,8 @@ glue <- function(text, .envir = parent.frame(), res <- .Call(glue_, text, f, .open, .close, .cli) res <- drop_null(res) - if (any(lengths(res) == 0)) { - return(character(0)) + if (any(lengths(res) == 0L)) { + return(character(0L)) } res[] <- lapply(res, function(x) replace(x, is.na(x), "NA")) @@ -44,7 +44,7 @@ glue <- function(text, .envir = parent.frame(), } count_brace_exp <- function(text, .open = "{", .close = "}") { - cnt <- 0 + cnt <- 0L trans <- function(text, envir) { cnt <<- cnt + 1L "" @@ -53,12 +53,12 @@ count_brace_exp <- function(text, .open = "{", .close = "}") { cnt } -identity_transformer <- function (text, envir) { +identity_transformer <- function(text, envir) { eval(parse(text = text, keep.source = FALSE), envir) } drop_null <- function(x) { - x[!vapply(x, is.null, logical(1))] + x[!vapply(x, is.null, logical(1L))] } #' Collapse a vector into a string scalar @@ -85,7 +85,7 @@ drop_null <- function(x) { #' @param width Limit for the display width of the result, in characters. #' This is a hard limit, and the output will never exceed it. #' This argument is not implemented for the `"both-ends"` style, which -#' always uses `Inf`, with a warning if a fininte `width` value is set. +#' always uses `Inf`, with a warning if a finite `width` value is set. #' @param ellipsis Character string to use at the place of the truncation. #' By default, the Unicode ellipsis character is used if the console is #' UTF-8, and three dots otherwise. @@ -122,11 +122,11 @@ ansi_collapse <- function(x, sep = ", ", last = ", and ", trunc = Inf, collapse_head_notrim <- function(x, trunc, sep, last, ellipsis) { lnx <- length(x) - if (lnx == 1) return(x) + if (lnx == 1L) return(x) if (lnx <= trunc) { # no truncation return(paste0( - paste(x[1:(lnx - 1)], collapse = sep), + paste(x[1:(lnx - 1L)], collapse = sep), last, x[lnx] )) @@ -147,8 +147,8 @@ collapse_head <- function(x, sep = ", ", last = ", and ", trunc = Inf, x <- as.character(x) lnx <- length(x) - # skepcial cases that do not need trimming - if (lnx == 0) { + # special cases that do not need trimming + if (lnx == 0L) { return("") } else if (any(is.na(x))) { return(NA_character_) @@ -199,7 +199,7 @@ collapse_head <- function(x, sep = ", ", last = ", and ", trunc = Inf, # we need to find the longest possible truncation for the form # x[1], x[2], x[trunc], ... # each item is wx + wsep wide, so we search how many fits, with ellipsis - last <- function(x) if (length(x) >= 1) x[length(x)] else x[NA_integer_] + last <- function(x) if (length(x) >= 1L) x[length(x)] else x[NA_integer_] trunc <- last(which(cumsum(wx + wsep) + well <= width)) # not even one element fits @@ -209,10 +209,10 @@ collapse_head <- function(x, sep = ", ", last = ", and ", trunc = Inf, } else if (well == width) { return(ellipsis) } else if (well + wsep >= width) { - return(paste0(ansi_strtrim(x[1], width, ellipsis = ""), ellipsis)) + return(paste0(ansi_strtrim(x[1L], width, ellipsis = ""), ellipsis)) } else { return(paste0( - ansi_strtrim(x[1], max(width - well - wsep, 0L), ellipsis = ellipsis), + ansi_strtrim(x[1L], max(width - well - wsep, 0L), ellipsis = ellipsis), sep, ellipsis )) @@ -244,18 +244,18 @@ collapse_both_ends <- function(x, sep = ", ", last = ", and ", trunc = Inf, return(collapse_head(x, sep, last, trunc = trunc, width, ellipsis)) } - # we have at list six elements in the vector + # we have at least six elements in the vector # 1, 2, 3, ..., 9, and 10 - x <- as.character(c(x[1:(trunc-2)], x[length(x)-1], x[length(x)])) + x <- as.character(c(x[1:(trunc - 2L)], x[length(x) - 1L], x[length(x)])) paste0( - c(x[1:(trunc-2)], ellipsis, paste0(x[trunc-1], last, x[trunc])), + c(x[1:(trunc - 2L)], ellipsis, paste0(x[trunc - 1L], last, x[trunc])), collapse = sep ) } -trim <- function (x) { +trim <- function(x) { has_newline <- function(x) any(grepl("\\n", x)) - if (length(x) == 0 || !has_newline(x)) { + if (length(x) == 0L || !has_newline(x)) { return(x) } .Call(trim_, x) diff --git a/R/hash.R b/R/hash.R index a8c43f7fe..e5b77589e 100644 --- a/R/hash.R +++ b/R/hash.R @@ -6,7 +6,7 @@ #' @param x Character vector. If not a character vector, then #' [as.character()] is used to try to coerce it into one. `NA` entries #' will have an `NA` hash. -#' @return `hash_sha256()` returns aharacter vector of hexadecimal +#' @return `hash_sha256()` returns a character vector of hexadecimal #' SHA-256 hashes. #' @family hash functions @@ -76,7 +76,7 @@ hash_file_sha256 <- function(paths) { #' @param x Character vector. If not a character vector, then #' [as.character()] is used to try to coerce it into one. `NA` entries #' will have an `NA` hash. -#' @return `hash_sha1()` returns aharacter vector of hexadecimal +#' @return `hash_sha1()` returns a character vector of hexadecimal #' SHA-1 hashes. #' @family hash functions @@ -194,7 +194,7 @@ hash_obj_md5 <- function(x, serialize_version = 2) { #' @export #' @rdname hash_md5 #' @param paths Character vector of file names. -#' @details `hash_file_md5()` calcultaes the MD5 hash of one of more +#' @details `hash_file_md5()` calculates the MD5 hash of one or more #' files. hash_file_md5 <- function(paths) { @@ -236,7 +236,7 @@ hash_file_md5 <- function(paths) { #' #' @param x Character vector. `NA` entries will have an `NA` hash. #' @param size Number of emojis to use in a hash. Currently it has to -#' be between 1 and 4. +#' be from 1 through 4. #' @return `hash_emoji()` returns a data frame with columns #' * `hash`: the emoji hash, a string of the requested size. #' * `emojis`: list column with the emoji characters in character @@ -378,7 +378,7 @@ hash_obj_emoji <- function(x, size = 3, serialize_version = 2) { #' } #' ``` #' -#' `hash_animals()` uses `r length(gfycat_animals)` animal names and +#' `hash_animal()` uses `r length(gfycat_animals)` animal names and #' `r length(gfycat_adjectives)` different adjectives. The number of #' different hashes you can get for different values of `n_adj`: #' @@ -397,7 +397,7 @@ hash_obj_emoji <- function(x, size = 3, serialize_version = 2) { #' from . #' #' @param x Character vector. `NA` entries will have an `NA` hash. -#' @param n_adj Number of adjectives to use. It must be between 0 and 3. +#' @param n_adj Number of adjectives to use. It must be from 0 through 3. #' @return A data frame with columns #' * `hash`: the hash value, a string. #' * `words`: list column with the adjectives and the animal name in a @@ -468,7 +468,7 @@ hash_animal1_transform <- function(md5, n_adj) { #' @export #' @rdname hash_animal -#' @details `hash_raw_anima()` calculates the adjective-animal hash of +#' @details `hash_raw_animal()` calculates the adjective-animal hash of #' the bytes of a raw vector. #' #' @return `hash_raw_animal()` and `hash_obj_animal()` return a list diff --git a/R/num-ansi-colors.R b/R/num-ansi-colors.R index 93715917c..c23cffa5f 100644 --- a/R/num-ansi-colors.R +++ b/R/num-ansi-colors.R @@ -106,6 +106,11 @@ num_ansi_colors <- function(stream = "auto") { # the `stderr()` stream, so we need to catch this case. if (is_stderr && sink.number("message") != 2) return(1L) + #' 1. If the `cli.default_num_colors` option is set, then we use that. + + dopt <- get_default_number_of_colors() + if (!is.null(dopt)) return(as.integer(dopt)) + #' 1. If R is running inside RGui on Windows, or R.app on macOS, then we #' return 1L. diff --git a/R/progress-along.R b/R/progress-along.R index 735c69e20..ec4d6b653 100644 --- a/R/progress-along.R +++ b/R/progress-along.R @@ -91,8 +91,10 @@ #' @return An index vector from 1 to `length(x)` that triggers progress #' updates as you iterate over it. #' +#' @seealso This function supports [inline markup][inline-markup]. #' @seealso [cli_progress_bar()] and the traditional progress bar API. -#' +#' @family progress bar functions +#' @family functions supporting inline markup #' @export cli_progress_along <- function(x, diff --git a/R/progress-bar.R b/R/progress-bar.R index 12075764a..fdad17af7 100644 --- a/R/progress-bar.R +++ b/R/progress-bar.R @@ -67,6 +67,7 @@ progress_style <- function(x) { #' @return A named list with sublists containing elements #' `complete`, `incomplete` and potentially `current`. #' +#' @family progress bar functions #' @export cli_progress_styles <- function() { diff --git a/R/progress-client.R b/R/progress-client.R index 3494590fb..b153b5f24 100644 --- a/R/progress-client.R +++ b/R/progress-client.R @@ -294,8 +294,11 @@ #' @return `cli_progress_bar()` returns the id of the new progress bar. #' The id is a string constant. #' +#' @seealso These functions support [inline markup][inline-markup]. #' @seealso [cli_progress_message()] and [cli_progress_step()] for simpler #' progress messages. +#' @family progress bar functions +#' @family functions supporting inline markup #' @aliases __cli_update_due cli_tick_reset ccli_tick_reset ticking #' @export @@ -539,6 +542,9 @@ cli_progress_done <- function(id = NULL, .envir = parent.frame(), #' @param .envir Environment to use for glue interpolation of `text`. #' @return `TRUE`, always. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family progress bar functions +#' @family functions supporting inline markup #' @export cli_progress_output <- function(text, id = NULL, .envir = parent.frame()) { @@ -608,8 +614,11 @@ cli_progress_output <- function(text, id = NULL, .envir = parent.frame()) { #' #' @return The id of the new progress bar. #' +#' @seealso This function supports [inline markup][inline-markup]. #' @seealso [cli_progress_bar()] for the complete progress bar API. #' [cli_progress_step()] for a similar display that is styled by default. +#' @family progress bar functions +#' @family functions supporting inline markup #' @export cli_progress_message <- function(msg, @@ -664,7 +673,7 @@ cli_progress_message <- function(msg, #' ## Spinner #' #' You can add a spinner to some or all steps with `spinner = TRUE`, -#' but not that this will only work if you call [cli_progress_update()] +#' but note that this will only work if you call [cli_progress_update()] #' regularly. #' #' ```{asciicast progress-step-spin} @@ -757,6 +766,9 @@ cli_progress_message <- function(msg, #' @param .envir Passed to [cli_progress_bar()]. #' @param ... Passed to [cli_progress_bar()]. #' +#' @seealso This function supports [inline markup][inline-markup]. +#' @family progress bar functions +#' @family functions supporting inline markup #' @export cli_progress_step <- function(msg, diff --git a/R/progress-server.R b/R/progress-server.R index 11043c4c3..2f2d8f509 100644 --- a/R/progress-server.R +++ b/R/progress-server.R @@ -70,6 +70,7 @@ #' @return `cli_progress_builtin_handlers()` returns the names of the #' currently supported progress handlers. #' +#' @family progress bar functions #' @export # TODO: examples diff --git a/R/progress-utils.R b/R/progress-utils.R index 8060fb52b..478040e7c 100644 --- a/R/progress-utils.R +++ b/R/progress-utils.R @@ -6,7 +6,7 @@ #' @return `cli_progress_num()` returns an integer scalar. #' #' @rdname progress-utils -#' @family progress bar +#' @family progress bar functions #' @export cli_progress_num <- function() { @@ -18,7 +18,6 @@ cli_progress_num <- function() { #' @return `cli_progress_cleanup() does not return anything. #' #' @rdname progress-utils -#' @family progress bar #' @export cli_progress_cleanup <- function() { diff --git a/R/progress-variables.R b/R/progress-variables.R index c6d3cd6d7..a81557709 100644 --- a/R/progress-variables.R +++ b/R/progress-variables.R @@ -11,6 +11,7 @@ #' Similarly, in R scripts, you can use `pb_bar` after `library(cli)`, #' or `cli::pb_bar` if you do not attach the cli package. #' +#' @family progress bar functions #' @name progress-variables NULL diff --git a/R/rlang.R b/R/rlang.R index 4973e3660..ce6e79e5b 100644 --- a/R/rlang.R +++ b/R/rlang.R @@ -32,6 +32,8 @@ #' @param .envir Environment to evaluate the glue expressions in. #' @inheritParams rlang::abort #' +#' @seealso These functions support [inline markup][inline-markup]. +#' @family functions supporting inline markup #' @export cli_abort <- function(message, diff --git a/R/status-bar.R b/R/status-bar.R index 22706d9ad..91701a405 100644 --- a/R/status-bar.R +++ b/R/status-bar.R @@ -43,9 +43,11 @@ #' @param .auto_result What to do when auto-closing the status bar. #' @return The id of the new status bar container element, invisibly. #' +#' @seealso Status bars support [inline markup][inline-markup]. #' @seealso The [cli_progress_message()] and [cli_progress_step()] #' functions, for a superior API. #' @family status bar +#' @family functions supporting inline markup #' @export cli_status <- function(msg, msg_done = paste(msg, "... done"), @@ -136,9 +138,11 @@ cli_status_clear <- function(id = NULL, result = c("clear", "done", "failed"), #' @param .envir Environment to evaluate the glue expressions in. #' @return Id of the status bar container. #' -#' @family status bar +#' @seealso This function supports [inline markup][inline-markup]. #' @seealso The [cli_progress_message()] and [cli_progress_step()] #' functions, for a superior API. +#' @family status bar +#' @family functions supporting inline markup #' @export cli_status_update <- function(id = NULL, msg = NULL, msg_done = NULL, @@ -193,9 +197,11 @@ cli_status_update <- function(id = NULL, msg = NULL, msg_done = NULL, #' @inheritParams cli_status #' @return Id of the status bar container. #' -#' @family status bar +#' @seealso This function supports [inline markup][inline-markup]. #' @seealso The [cli_progress_message()] and [cli_progress_step()] #' functions, for a superior API. +#' @family status bar +#' @family functions supporting inline markup #' @export #' @examples #' diff --git a/inst/scripts/news.R b/exec/news.R similarity index 97% rename from inst/scripts/news.R rename to exec/news.R index ec219ce8e..99c155734 100755 --- a/inst/scripts/news.R +++ b/exec/news.R @@ -107,11 +107,12 @@ New package releases on CRAN format_result <- function(result) { pkg <- result$package ago <- vague_dt(Sys.time() - parse_iso_8601(result$date)) + url <- paste0("https://r-pkg.org/pkg/", pkg$Package) cli_li() cli_text("{.pkg {pkg$Package}} {pkg$Version} -- {ago} by {.emph {pkg$Maintainer}}") cli_text("{pkg$Title}") - cli_text("{.url https://r-pkg.org/pkg/{pkg$Package}}") + cli_text("{.url {url}}") } if (is.null(sys.calls())) { diff --git a/inst/scripts/outdated.R b/exec/outdated.R similarity index 100% rename from inst/scripts/outdated.R rename to exec/outdated.R diff --git a/inst/scripts/search.R b/exec/search.R similarity index 100% rename from inst/scripts/search.R rename to exec/search.R diff --git a/inst/scripts/up.R b/exec/up.R similarity index 100% rename from inst/scripts/up.R rename to exec/up.R diff --git a/inst/examples/apps/news.R b/inst/examples/apps/news.R index ec219ce8e..99c155734 100755 --- a/inst/examples/apps/news.R +++ b/inst/examples/apps/news.R @@ -107,11 +107,12 @@ New package releases on CRAN format_result <- function(result) { pkg <- result$package ago <- vague_dt(Sys.time() - parse_iso_8601(result$date)) + url <- paste0("https://r-pkg.org/pkg/", pkg$Package) cli_li() cli_text("{.pkg {pkg$Package}} {pkg$Version} -- {ago} by {.emph {pkg$Maintainer}}") cli_text("{pkg$Title}") - cli_text("{.url https://r-pkg.org/pkg/{pkg$Package}}") + cli_text("{.url {url}}") } if (is.null(sys.calls())) { diff --git a/man/ansi_collapse.Rd b/man/ansi_collapse.Rd index b4dd3a457..062ea3d50 100644 --- a/man/ansi_collapse.Rd +++ b/man/ansi_collapse.Rd @@ -30,7 +30,7 @@ at least \code{trunc = 1} is used. For \code{style = "both-ends"} at least \item{width}{Limit for the display width of the result, in characters. This is a hard limit, and the output will never exceed it. This argument is not implemented for the \code{"both-ends"} style, which -always uses \code{Inf}, with a warning if a fininte \code{width} value is set.} +always uses \code{Inf}, with a warning if a finite \code{width} value is set.} \item{ellipsis}{Character string to use at the place of the truncation. By default, the Unicode ellipsis character is used if the console is diff --git a/man/cli-config.Rd b/man/cli-config.Rd index 46d92866e..41f8205d8 100644 --- a/man/cli-config.Rd +++ b/man/cli-config.Rd @@ -88,9 +88,25 @@ See \url{https://cli.r-lib.org/articles/semantic-cli.html#cli-messages-1} \subsection{\code{cli.default_num_colors}}{ -Default number of ANSI colors. This value is only used if ANSI color support -is detected. You can set this value to keep relying on auto-detection, -but to adjust the number of colors when cli detects color support. +Default number of ANSI colors. This value is used if the number of colors +is not already set by +\itemize{ +\item the \code{cli.num_colors} option, +\item the \code{R_CLI_NUM_COLORS} environment variable, +\item the \code{crayon.enabled} and \code{crayon.colors} options, +\item the \code{NO_COLOR} environment variable, +\item the \code{knitr.in.progress} option, +\item a \code{sink()} call for the stream. +} + +You can also use this option if color support is detected correctly, but +you want to adjust the number of colors. E.g. +\itemize{ +\item if \code{crayon.enabled} is \code{TRUE}, but \code{crayon.colors} is not, +\item in Emacs on Windows, +\item in terminals. +} + See \code{\link[=num_ansi_colors]{num_ansi_colors()}}. See also the \code{cli.num_colors} option. } diff --git a/man/cli_abort.Rd b/man/cli_abort.Rd index dbb14a3f6..25e5e29c1 100644 --- a/man/cli_abort.Rd +++ b/man/cli_abort.Rd @@ -83,3 +83,30 @@ cli_abort(c( }} } +\seealso{ +These functions support \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_alert.Rd b/man/cli_alert.Rd index 80c4f2805..f1ecd410b 100644 --- a/man/cli_alert.Rd +++ b/man/cli_alert.Rd @@ -123,3 +123,30 @@ cli_alert_info("Data columns: \{.val \{names(mtcars)\}\}.", wrap = TRUE) } } +\seealso{ +These functions supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_blockquote.Rd b/man/cli_blockquote.Rd index c39d4e678..37b13074d 100644 --- a/man/cli_blockquote.Rd +++ b/man/cli_blockquote.Rd @@ -49,3 +49,30 @@ cli_blockquote(evil, citation = "Donald Ervin Knuth") }} } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_bullets.Rd b/man/cli_bullets.Rd index 252b0d397..7793fc86c 100644 --- a/man/cli_bullets.Rd +++ b/man/cli_bullets.Rd @@ -67,3 +67,30 @@ corresponding \verb{bullet-} classes. }} } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_bullets_raw.Rd b/man/cli_bullets_raw.Rd index 4be8515ac..3b3dfba45 100644 --- a/man/cli_bullets_raw.Rd +++ b/man/cli_bullets_raw.Rd @@ -25,5 +25,31 @@ not perform any inline styling or glue substitutions in the input. \code{format_bullets_raw()} returns the output instead of printing it. } \seealso{ +These functions support \link[=inline-markup]{inline markup}. + See \code{\link[=cli_bullets]{cli_bullets()}} for examples. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} diff --git a/man/cli_dl.Rd b/man/cli_dl.Rd index f939760c7..7b5866eea 100644 --- a/man/cli_dl.Rd +++ b/man/cli_dl.Rd @@ -77,3 +77,30 @@ fun() } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_h1.Rd b/man/cli_h1.Rd index b4b3ac08f..a5b3c1e0f 100644 --- a/man/cli_h1.Rd +++ b/man/cli_h1.Rd @@ -42,3 +42,30 @@ cli_h3("Header \{.emph 3\}") }} } +\seealso{ +These functions supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_li.Rd b/man/cli_li.Rd index c96db208b..cbb176164 100644 --- a/man/cli_li.Rd +++ b/man/cli_li.Rd @@ -61,3 +61,30 @@ fun() } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_ol.Rd b/man/cli_ol.Rd index 073e6a490..fe1531ebb 100644 --- a/man/cli_ol.Rd +++ b/man/cli_ol.Rd @@ -101,3 +101,30 @@ fun() } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_process_start.Rd b/man/cli_process_start.Rd index 1645db605..631ebee68 100644 --- a/man/cli_process_start.Rd +++ b/man/cli_process_start.Rd @@ -112,6 +112,8 @@ fun2 <- function() { fun2() } \seealso{ +This function supports \link[=inline-markup]{inline markup}. + The \code{\link[=cli_progress_message]{cli_progress_message()}} and \code{\link[=cli_progress_step]{cli_progress_step()}} functions, for a superior API. @@ -119,5 +121,29 @@ Other status bar: \code{\link{cli_status_clear}()}, \code{\link{cli_status_update}()}, \code{\link{cli_status}()} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} \concept{status bar} diff --git a/man/cli_progress_along.Rd b/man/cli_progress_along.Rd index a0b16c4ce..88c900ae9 100644 --- a/man/cli_progress_along.Rd +++ b/man/cli_progress_along.Rd @@ -103,5 +103,42 @@ or right after the loop: } } \seealso{ +This function supports \link[=inline-markup]{inline markup}. + \code{\link[=cli_progress_bar]{cli_progress_bar()}} and the traditional progress bar API. + +Other progress bar functions: +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} +\concept{progress bar functions} diff --git a/man/cli_progress_bar.Rd b/man/cli_progress_bar.Rd index dbe23e30f..8bf2ba299 100644 --- a/man/cli_progress_bar.Rd +++ b/man/cli_progress_bar.Rd @@ -361,6 +361,43 @@ fun(paste0("https://acme.com/data-", 1:10, ".zip")) } } \seealso{ +These functions support \link[=inline-markup]{inline markup}. + \code{\link[=cli_progress_message]{cli_progress_message()}} and \code{\link[=cli_progress_step]{cli_progress_step()}} for simpler progress messages. + +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} +\concept{progress bar functions} diff --git a/man/cli_progress_builtin_handlers.Rd b/man/cli_progress_builtin_handlers.Rd index 86ffb63de..7a086be6e 100644 --- a/man/cli_progress_builtin_handlers.Rd +++ b/man/cli_progress_builtin_handlers.Rd @@ -84,3 +84,15 @@ This handler is available if a shiny app is running. } } +\seealso{ +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} +} +\concept{progress bar functions} diff --git a/man/cli_progress_message.Rd b/man/cli_progress_message.Rd index 5c4ca75e4..9aa3fb679 100644 --- a/man/cli_progress_message.Rd +++ b/man/cli_progress_message.Rd @@ -60,6 +60,43 @@ fun() \if{html}{\figure{progress-message.svg}} } \seealso{ +This function supports \link[=inline-markup]{inline markup}. + \code{\link[=cli_progress_bar]{cli_progress_bar()}} for the complete progress bar API. \code{\link[=cli_progress_step]{cli_progress_step()}} for a similar display that is styled by default. + +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} +\concept{progress bar functions} diff --git a/man/cli_progress_output.Rd b/man/cli_progress_output.Rd index 0fdeb6361..ce43e33d9 100644 --- a/man/cli_progress_output.Rd +++ b/man/cli_progress_output.Rd @@ -43,3 +43,41 @@ fun() \if{html}{\figure{progress-output2.svg}} } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} +\concept{progress bar functions} diff --git a/man/cli_progress_step.Rd b/man/cli_progress_step.Rd index d56d7650c..37ef67943 100644 --- a/man/cli_progress_step.Rd +++ b/man/cli_progress_step.Rd @@ -72,7 +72,7 @@ f() \subsection{Spinner}{ You can add a spinner to some or all steps with \code{spinner = TRUE}, -but not that this will only work if you call \code{\link[=cli_progress_update]{cli_progress_update()}} +but note that this will only work if you call \code{\link[=cli_progress_update]{cli_progress_update()}} regularly. \if{html}{\out{
}}\preformatted{f <- function() \{ @@ -142,3 +142,41 @@ f() \if{html}{\figure{progress-step-msg.svg}} } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} +\concept{progress bar functions} diff --git a/man/cli_progress_styles.Rd b/man/cli_progress_styles.Rd index d69ae9a34..cde200d3e 100644 --- a/man/cli_progress_styles.Rd +++ b/man/cli_progress_styles.Rd @@ -43,3 +43,15 @@ options(cli.progress_var_style = NULL)
}} } +\seealso{ +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{progress-variables}} +} +\concept{progress bar functions} diff --git a/man/cli_rule.Rd b/man/cli_rule.Rd index 82ac32af7..c18e4db4e 100644 --- a/man/cli_rule.Rd +++ b/man/cli_rule.Rd @@ -68,3 +68,30 @@ cli_end(d) } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_status.Rd b/man/cli_status.Rd index 0ecfae2f1..070589d3d 100644 --- a/man/cli_status.Rd +++ b/man/cli_status.Rd @@ -66,6 +66,8 @@ again. cli automates much of this, via the \code{msg_done}, \code{msg_failed}, a \code{.auto_result} arguments. See examples below. } \seealso{ +Status bars support \link[=inline-markup]{inline markup}. + The \code{\link[=cli_progress_message]{cli_progress_message()}} and \code{\link[=cli_progress_step]{cli_progress_step()}} functions, for a superior API. @@ -73,5 +75,29 @@ Other status bar: \code{\link{cli_process_start}()}, \code{\link{cli_status_clear}()}, \code{\link{cli_status_update}()} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} \concept{status bar} diff --git a/man/cli_status_update.Rd b/man/cli_status_update.Rd index 35e8b89db..04f5d17dc 100644 --- a/man/cli_status_update.Rd +++ b/man/cli_status_update.Rd @@ -38,6 +38,8 @@ because they have a better default behavior.} Update the status bar } \seealso{ +This function supports \link[=inline-markup]{inline markup}. + The \code{\link[=cli_progress_message]{cli_progress_message()}} and \code{\link[=cli_progress_step]{cli_progress_step()}} functions, for a superior API. @@ -45,5 +47,29 @@ Other status bar: \code{\link{cli_process_start}()}, \code{\link{cli_status_clear}()}, \code{\link{cli_status}()} + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} } +\concept{functions supporting inline markup} \concept{status bar} diff --git a/man/cli_text.Rd b/man/cli_text.Rd index 592fd4735..4b1758a7f 100644 --- a/man/cli_text.Rd +++ b/man/cli_text.Rd @@ -126,3 +126,30 @@ cli_end(ul) } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/cli_ul.Rd b/man/cli_ul.Rd index 40eaa986d..a5f13b3ff 100644 --- a/man/cli_ul.Rd +++ b/man/cli_ul.Rd @@ -76,3 +76,30 @@ fun() } } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{format_error}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/figures/demo-spinners.svg b/man/figures/demo-spinners.svg index 6f3a9943b..cb2dffd8a 100644 --- a/man/figures/demo-spinners.svg +++ b/man/figures/demo-spinners.svg @@ -1 +1 @@ -🕐🕐clock🕑clock🕒clock🕓clock🕔clock🕕clock🕖clock🕗clock🕘clock🕙clock🕚clock \ No newline at end of file +🕛🕛clock🕐clock🕑clock🕒clock🕓clock🕔clock🕕clock🕖clock🕗clock🕘clock🕙clock🕚clock \ No newline at end of file diff --git a/man/figures/get-spinner.svg b/man/figures/get-spinner.svg index e5aa12be5..7c1eccccf 100644 --- a/man/figures/get-spinner.svg +++ b/man/figures/get-spinner.svg @@ -1 +1 @@ -❤️Spinning100done(22/s)|4.6s💙Spinning1done(22/s)|46ms💜Spinning3done(21/s)|141ms💚Spinning7done(22/s)|323ms❤️Spinning11done(21/s)|516ms💛Spinning16done(21/s)|746ms💙Spinning20done(22/s)|928ms💜Spinning25done(22/s)|1.2s💚Spinning29done(22/s)|1.3s❤️Spinning34done(22/s)|1.6s💛Spinning38done(22/s)|1.8s💙Spinning42done(22/s)|1.9s💜Spinning47done(22/s)|2.2s💚Spinning51done(22/s)|2.4s❤️Spinning55done(22/s)|2.5s💛Spinning60done(22/s)|2.8s💙Spinning64done(22/s)|3s💜Spinning69done(22/s)|3.2s💚Spinning73done(22/s)|3.4s❤️Spinning78done(22/s)|3.6s💛Spinning82done(22/s)|3.8s💙Spinning86done(22/s)|4s💜Spinning91done(22/s)|4.2s💚Spinning95done(22/s)|4.4s \ No newline at end of file +❤️Spinning100done(21/s)|4.8s💙Spinning1done(22/s)|46ms💜Spinning2done(21/s)|94ms💚Spinning7done(22/s)|324ms❤️Spinning11done(21/s)|521ms💛Spinning15done(21/s)|721ms💙Spinning19done(21/s)|920ms💜Spinning24done(21/s)|1.2s💚Spinning28done(21/s)|1.3s❤️Spinning32done(21/s)|1.5s💛Spinning36done(21/s)|1.7s💙Spinning41done(21/s)|2s💜Spinning45done(21/s)|2.2s💚Spinning49done(21/s)|2.3s❤️Spinning54done(21/s)|2.6s💛Spinning58done(21/s)|2.8s💙Spinning62done(21/s)|3s💜Spinning67done(21/s)|3.2s💚Spinning71done(21/s)|3.4s❤️Spinning75done(21/s)|3.6s💛Spinning79done(21/s)|3.8s💙Spinning84done(21/s)|4s💜Spinning88done(21/s)|4.2s💚Spinning92done(21/s)|4.4s❤️Spinning96done(21/s)|4.6s \ No newline at end of file diff --git a/man/figures/make-spinner-custom.svg b/man/figures/make-spinner-custom.svg index 13e8aa3a7..bb5cc8393 100644 --- a/man/figures/make-spinner-custom.svg +++ b/man/figures/make-spinner-custom.svg @@ -1 +1 @@ -Downloading.Downloading..Downloading...Downloading..Downloading.Downloading \ No newline at end of file +Downloading.Downloading..Downloading...Downloading..Downloading.Downloading \ No newline at end of file diff --git a/man/figures/make-spinner-default.svg b/man/figures/make-spinner-default.svg index 8b168c0f1..1dbc62bb7 100644 --- a/man/figures/make-spinner-default.svg +++ b/man/figures/make-spinner-default.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/man/figures/make-spinner-template.svg b/man/figures/make-spinner-template.svg index 6a2cad979..3ec97ebc2 100644 --- a/man/figures/make-spinner-template.svg +++ b/man/figures/make-spinner-template.svg @@ -1 +1 @@ -ComputingComputingComputingComputingComputingComputingComputingComputingComputingComputing \ No newline at end of file +ComputingComputingComputingComputingComputingComputingComputingComputingComputingComputing \ No newline at end of file diff --git a/man/figures/progress-1.svg b/man/figures/progress-1.svg index fa8eebbbb..84ee4c06a 100644 --- a/man/figures/progress-1.svg +++ b/man/figures/progress-1.svg @@ -1 +1 @@ -Cleaningdata███████████████████████████████100%|ETA:0sCleaningdata██████████████████████████████1%|ETA:5sCleaningdata███████████████████████████████5%|ETA:5sCleaningdata███████████████████████████████8%|ETA:5sCleaningdata███████████████████████████████12%|ETA:5sCleaningdata███████████████████████████████15%|ETA:5sCleaningdata███████████████████████████████19%|ETA:5sCleaningdata███████████████████████████████22%|ETA:4sCleaningdata███████████████████████████████26%|ETA:4sCleaningdata███████████████████████████████30%|ETA:4sCleaningdata███████████████████████████████33%|ETA:4sCleaningdata███████████████████████████████36%|ETA:4sCleaningdata███████████████████████████████40%|ETA:3sCleaningdata███████████████████████████████44%|ETA:3sCleaningdata███████████████████████████████47%|ETA:3sCleaningdata███████████████████████████████51%|ETA:3sCleaningdata███████████████████████████████54%|ETA:3sCleaningdata███████████████████████████████58%|ETA:2sCleaningdata███████████████████████████████61%|ETA:2sCleaningdata███████████████████████████████65%|ETA:2sCleaningdata███████████████████████████████68%|ETA:2sCleaningdata███████████████████████████████72%|ETA:2sCleaningdata███████████████████████████████75%|ETA:1sCleaningdata███████████████████████████████79%|ETA:1sCleaningdata███████████████████████████████83%|ETA:1sCleaningdata███████████████████████████████86%|ETA:1sCleaningdata███████████████████████████████89%|ETA:1sCleaningdata███████████████████████████████93%|ETA:0sCleaningdata██████████████████████████████97%|ETA:0s \ No newline at end of file +Cleaningdata███████████████████████████████100%|ETA:0sCleaningdata███████████████████████████████3%|ETA:5sCleaningdata███████████████████████████████7%|ETA:5sCleaningdata███████████████████████████████10%|ETA:5sCleaningdata███████████████████████████████14%|ETA:5sCleaningdata███████████████████████████████17%|ETA:5sCleaningdata███████████████████████████████20%|ETA:5sCleaningdata███████████████████████████████24%|ETA:4sCleaningdata███████████████████████████████27%|ETA:4sCleaningdata███████████████████████████████31%|ETA:4sCleaningdata███████████████████████████████34%|ETA:4sCleaningdata███████████████████████████████38%|ETA:4sCleaningdata███████████████████████████████41%|ETA:3sCleaningdata███████████████████████████████45%|ETA:3sCleaningdata███████████████████████████████48%|ETA:3sCleaningdata███████████████████████████████51%|ETA:3sCleaningdata███████████████████████████████55%|ETA:3sCleaningdata███████████████████████████████58%|ETA:2sCleaningdata███████████████████████████████62%|ETA:2sCleaningdata███████████████████████████████65%|ETA:2sCleaningdata███████████████████████████████69%|ETA:2sCleaningdata███████████████████████████████72%|ETA:2sCleaningdata███████████████████████████████76%|ETA:1sCleaningdata███████████████████████████████79%|ETA:1sCleaningdata███████████████████████████████83%|ETA:1sCleaningdata███████████████████████████████87%|ETA:1sCleaningdata███████████████████████████████90%|ETA:1sCleaningdata███████████████████████████████94%|ETA:0sCleaningdata██████████████████████████████97%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-after.svg b/man/figures/progress-after.svg index 8fa62dc6e..c60cffdae 100644 --- a/man/figures/progress-after.svg +++ b/man/figures/progress-after.svg @@ -1 +1 @@ -Startingnow,at2022-08-2219:17:42███████████████████████████████100%@2022-08-2219:17:47███████████████████████████████46%@2022-08-2219:17:44███████████████████████████████47%@2022-08-2219:17:44███████████████████████████████51%@2022-08-2219:17:45███████████████████████████████55%@2022-08-2219:17:45███████████████████████████████60%@2022-08-2219:17:45███████████████████████████████64%@2022-08-2219:17:45███████████████████████████████69%@2022-08-2219:17:45███████████████████████████████73%@2022-08-2219:17:46███████████████████████████████78%@2022-08-2219:17:46███████████████████████████████82%@2022-08-2219:17:46███████████████████████████████86%@2022-08-2219:17:46███████████████████████████████90%@2022-08-2219:17:46███████████████████████████████95%@2022-08-2219:17:47███████████████████████████████99%@2022-08-2219:17:47 \ No newline at end of file +Startingnow,at2022-09-0711:26:44███████████████████████████████100%@2022-09-0711:26:49███████████████████████████████47%@2022-09-0711:26:46███████████████████████████████49%@2022-09-0711:26:46███████████████████████████████53%@2022-09-0711:26:46███████████████████████████████58%@2022-09-0711:26:47███████████████████████████████62%@2022-09-0711:26:47███████████████████████████████67%@2022-09-0711:26:47███████████████████████████████71%@2022-09-0711:26:47███████████████████████████████75%@2022-09-0711:26:48███████████████████████████████80%@2022-09-0711:26:48███████████████████████████████84%@2022-09-0711:26:48███████████████████████████████88%@2022-09-0711:26:48███████████████████████████████92%@2022-09-0711:26:48██████████████████████████████97%@2022-09-0711:26:49 \ No newline at end of file diff --git a/man/figures/progress-along-1.svg b/man/figures/progress-along-1.svg index e430537f8..24d0fbea2 100644 --- a/man/figures/progress-along-1.svg +++ b/man/figures/progress-along-1.svg @@ -1 +1 @@ -Downloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sDownloading0%|ETA:?Downloading■■■6%|ETA:4sDownloading■■■■10%|ETA:4sDownloading■■■■■14%|ETA:4sDownloading■■■■■■■19%|ETA:4sDownloading■■■■■■■■23%|ETA:4sDownloading■■■■■■■■■27%|ETA:3sDownloading■■■■■■■■■■31%|ETA:3sDownloading■■■■■■■■■■■■36%|ETA:3sDownloading■■■■■■■■■■■■■40%|ETA:3sDownloading■■■■■■■■■■■■■■■45%|ETA:3sDownloading■■■■■■■■■■■■■■■■49%|ETA:2sDownloading■■■■■■■■■■■■■■■■■53%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■57%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■61%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■66%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■■70%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■74%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■79%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■83%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■87%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■92%|ETA:0sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0s \ No newline at end of file +Downloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sDownloading0%|ETA:?Downloading■■■6%|ETA:4sDownloading■■■■11%|ETA:4sDownloading■■■■■15%|ETA:4sDownloading■■■■■■■19%|ETA:4sDownloading■■■■■■■■24%|ETA:4sDownloading■■■■■■■■■28%|ETA:3sDownloading■■■■■■■■■■■32%|ETA:3sDownloading■■■■■■■■■■■■37%|ETA:3sDownloading■■■■■■■■■■■■■■42%|ETA:3sDownloading■■■■■■■■■■■■■■■46%|ETA:2sDownloading■■■■■■■■■■■■■■■■50%|ETA:2sDownloading■■■■■■■■■■■■■■■■■55%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■59%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■64%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■68%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■72%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■77%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■81%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■85%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%|ETA:0sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■94%|ETA:0sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-along-2.svg b/man/figures/progress-along-2.svg index e65205e3e..89ee14eaf 100644 --- a/man/figures/progress-along-2.svg +++ b/man/figures/progress-along-2.svg @@ -1 +1 @@ -Downloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sDownloading0%|ETA:?Downloading■■■6%|ETA:4sDownloading■■■■10%|ETA:4sDownloading■■■■■14%|ETA:4sDownloading■■■■■■18%|ETA:4sDownloading■■■■■■■■22%|ETA:4sDownloading■■■■■■■■■27%|ETA:3sDownloading■■■■■■■■■■31%|ETA:3sDownloading■■■■■■■■■■■35%|ETA:3sDownloading■■■■■■■■■■■■■39%|ETA:3sDownloading■■■■■■■■■■■■■■44%|ETA:3sDownloading■■■■■■■■■■■■■■■48%|ETA:2sDownloading■■■■■■■■■■■■■■■■■52%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■56%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■61%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■65%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■■69%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■78%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■86%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%|ETA:0s \ No newline at end of file +Downloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sDownloading0%|ETA:?Downloading■■■6%|ETA:4sDownloading■■■■10%|ETA:4sDownloading■■■■■15%|ETA:4sDownloading■■■■■■■19%|ETA:4sDownloading■■■■■■■■23%|ETA:4sDownloading■■■■■■■■■28%|ETA:3sDownloading■■■■■■■■■■■32%|ETA:3sDownloading■■■■■■■■■■■■36%|ETA:3sDownloading■■■■■■■■■■■■■41%|ETA:3sDownloading■■■■■■■■■■■■■■■45%|ETA:3sDownloading■■■■■■■■■■■■■■■■49%|ETA:2sDownloading■■■■■■■■■■■■■■■■■54%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■58%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■62%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■67%|ETA:2sDownloading■■■■■■■■■■■■■■■■■■■■■■71%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■84%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■89%|ETA:1sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sDownloading■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-along-3.svg b/man/figures/progress-along-3.svg index 801b29676..f8586dfd6 100644 --- a/man/figures/progress-along-3.svg +++ b/man/figures/progress-along-3.svg @@ -1 +1 @@ -Downloadingdatafile100Downloadingdatafile0Downloadingdatafile5Downloadingdatafile10Downloadingdatafile15Downloadingdatafile19Downloadingdatafile24Downloadingdatafile29Downloadingdatafile33Downloadingdatafile38Downloadingdatafile43Downloadingdatafile47Downloadingdatafile51Downloadingdatafile56Downloadingdatafile61Downloadingdatafile65Downloadingdatafile70Downloadingdatafile74Downloadingdatafile79Downloadingdatafile84Downloadingdatafile88Downloadingdatafile92Downloadingdatafile97 \ No newline at end of file +Downloadingdatafile100Downloadingdatafile0Downloadingdatafile7Downloadingdatafile11Downloadingdatafile16Downloadingdatafile21Downloadingdatafile25Downloadingdatafile30Downloadingdatafile35Downloadingdatafile39Downloadingdatafile44Downloadingdatafile48Downloadingdatafile53Downloadingdatafile57Downloadingdatafile62Downloadingdatafile66Downloadingdatafile71Downloadingdatafile76Downloadingdatafile81Downloadingdatafile85Downloadingdatafile90Downloadingdatafile95Downloadingdatafile99 \ No newline at end of file diff --git a/man/figures/progress-clear.svg b/man/figures/progress-clear.svg index 09b1dc43f..c3b4ac31b 100644 --- a/man/figures/progress-clear.svg +++ b/man/figures/progress-clear.svg @@ -1 +1 @@ -Parametertuning███████████████████████████████100%|ETA:0sDatacleaning██████████████████████████████1%|ETA:3sDatacleaning███████████████████████████████5%|ETA:3sDatacleaning███████████████████████████████11%|ETA:3sDatacleaning███████████████████████████████16%|ETA:3sDatacleaning███████████████████████████████22%|ETA:3sDatacleaning███████████████████████████████27%|ETA:3sDatacleaning███████████████████████████████33%|ETA:2sDatacleaning███████████████████████████████38%|ETA:2sDatacleaning███████████████████████████████44%|ETA:2sDatacleaning███████████████████████████████49%|ETA:2sDatacleaning███████████████████████████████55%|ETA:2sDatacleaning███████████████████████████████60%|ETA:1sDatacleaning███████████████████████████████66%|ETA:1sDatacleaning███████████████████████████████71%|ETA:1sDatacleaning███████████████████████████████76%|ETA:1sDatacleaning███████████████████████████████82%|ETA:1sDatacleaning███████████████████████████████88%|ETA:0sDatacleaning███████████████████████████████93%|ETA:0sDatacleaning███████████████████████████████99%|ETA:0sParametertuning███████████████████████████████4%|ETA:3sParametertuning███████████████████████████████9%|ETA:3sParametertuning███████████████████████████████15%|ETA:3sParametertuning███████████████████████████████21%|ETA:3sParametertuning███████████████████████████████26%|ETA:3sParametertuning███████████████████████████████31%|ETA:3sParametertuning███████████████████████████████37%|ETA:2sParametertuning███████████████████████████████42%|ETA:2sParametertuning███████████████████████████████48%|ETA:2sParametertuning███████████████████████████████53%|ETA:2sParametertuning███████████████████████████████59%|ETA:2sParametertuning███████████████████████████████64%|ETA:1sParametertuning███████████████████████████████70%|ETA:1sParametertuning███████████████████████████████76%|ETA:1sParametertuning███████████████████████████████81%|ETA:1sParametertuning███████████████████████████████87%|ETA:0sParametertuning███████████████████████████████92%|ETA:0sParametertuning██████████████████████████████97%|ETA:0s \ No newline at end of file +Parametertuning███████████████████████████████100%|ETA:0sDatacleaning██████████████████████████████1%|ETA:3sDatacleaning███████████████████████████████6%|ETA:3sDatacleaning███████████████████████████████11%|ETA:3sDatacleaning███████████████████████████████17%|ETA:3sDatacleaning███████████████████████████████22%|ETA:3sDatacleaning███████████████████████████████28%|ETA:3sDatacleaning███████████████████████████████33%|ETA:2sDatacleaning███████████████████████████████38%|ETA:2sDatacleaning███████████████████████████████44%|ETA:2sDatacleaning███████████████████████████████49%|ETA:2sDatacleaning███████████████████████████████55%|ETA:2sDatacleaning███████████████████████████████60%|ETA:1sDatacleaning███████████████████████████████66%|ETA:1sDatacleaning███████████████████████████████71%|ETA:1sDatacleaning███████████████████████████████77%|ETA:1sDatacleaning███████████████████████████████82%|ETA:1sDatacleaning███████████████████████████████88%|ETA:0sDatacleaning███████████████████████████████94%|ETA:0sDatacleaning███████████████████████████████99%|ETA:0sParametertuning███████████████████████████████4%|ETA:3sParametertuning███████████████████████████████10%|ETA:3sParametertuning███████████████████████████████15%|ETA:3sParametertuning███████████████████████████████21%|ETA:3sParametertuning███████████████████████████████26%|ETA:3sParametertuning███████████████████████████████32%|ETA:2sParametertuning███████████████████████████████38%|ETA:2sParametertuning███████████████████████████████43%|ETA:2sParametertuning███████████████████████████████48%|ETA:2sParametertuning███████████████████████████████54%|ETA:2sParametertuning███████████████████████████████59%|ETA:1sParametertuning███████████████████████████████65%|ETA:1sParametertuning███████████████████████████████70%|ETA:1sParametertuning███████████████████████████████76%|ETA:1sParametertuning███████████████████████████████81%|ETA:1sParametertuning███████████████████████████████87%|ETA:0sParametertuning███████████████████████████████93%|ETA:0sParametertuning██████████████████████████████98%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-current.svg b/man/figures/progress-current.svg index dfabf4188..612af5641 100644 --- a/man/figures/progress-current.svg +++ b/man/figures/progress-current.svg @@ -1 +1 @@ -Firststep███████████████████████████████100%|ETA:0sSecondstep███████████████████████████████100%|ETA:0sFirststep██████████████████████████████1%|ETA:3sFirststep███████████████████████████████9%|ETA:2sFirststep███████████████████████████████16%|ETA:2sFirststep███████████████████████████████24%|ETA:2sFirststep███████████████████████████████31%|ETA:2sFirststep███████████████████████████████39%|ETA:2sFirststep███████████████████████████████47%|ETA:1sFirststep███████████████████████████████55%|ETA:1sFirststep███████████████████████████████63%|ETA:1sFirststep███████████████████████████████70%|ETA:1sFirststep███████████████████████████████78%|ETA:1sFirststep███████████████████████████████86%|ETA:0sFirststep███████████████████████████████93%|ETA:0sSecondstep███████████████████████████████8%|ETA:2sSecondstep███████████████████████████████16%|ETA:2sSecondstep███████████████████████████████23%|ETA:2sSecondstep███████████████████████████████31%|ETA:2sSecondstep███████████████████████████████38%|ETA:2sSecondstep███████████████████████████████45%|ETA:1sSecondstep███████████████████████████████53%|ETA:1sSecondstep███████████████████████████████61%|ETA:1sSecondstep███████████████████████████████69%|ETA:1sSecondstep███████████████████████████████77%|ETA:1sSecondstep███████████████████████████████84%|ETA:0sSecondstep███████████████████████████████92%|ETA:0s \ No newline at end of file +Firststep███████████████████████████████100%|ETA:0sSecondstep███████████████████████████████100%|ETA:0sFirststep██████████████████████████████1%|ETA:3sFirststep███████████████████████████████2%|ETA:3sFirststep███████████████████████████████11%|ETA:2sFirststep███████████████████████████████18%|ETA:2sFirststep███████████████████████████████26%|ETA:2sFirststep███████████████████████████████33%|ETA:2sFirststep███████████████████████████████40%|ETA:2sFirststep███████████████████████████████48%|ETA:1sFirststep███████████████████████████████55%|ETA:1sFirststep███████████████████████████████63%|ETA:1sFirststep███████████████████████████████70%|ETA:1sFirststep███████████████████████████████78%|ETA:1sFirststep███████████████████████████████85%|ETA:0sFirststep███████████████████████████████93%|ETA:0sSecondstep███████████████████████████████7%|ETA:2sSecondstep███████████████████████████████15%|ETA:2sSecondstep███████████████████████████████22%|ETA:2sSecondstep███████████████████████████████30%|ETA:2sSecondstep███████████████████████████████37%|ETA:2sSecondstep███████████████████████████████45%|ETA:1sSecondstep███████████████████████████████53%|ETA:1sSecondstep███████████████████████████████60%|ETA:1sSecondstep███████████████████████████████67%|ETA:1sSecondstep███████████████████████████████74%|ETA:1sSecondstep███████████████████████████████82%|ETA:0sSecondstep███████████████████████████████89%|ETA:0sSecondstep██████████████████████████████97%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-format.svg b/man/figures/progress-format.svg index 3758e1021..963e71af7 100644 --- a/man/figures/progress-format.svg +++ b/man/figures/progress-format.svg @@ -1 +1 @@ -Downloaded10filesin4.7s.Downloadingdata-1.zip[1/10]ETA:0sDownloadingdata-2.zip[2/10]ETA:2sDownloadingdata-3.zip[3/10]ETA:2sDownloadingdata-4.zip[4/10]ETA:2sDownloadingdata-5.zip[5/10]ETA:2sDownloadingdata-6.zip[6/10]ETA:2sDownloadingdata-7.zip[7/10]ETA:1sDownloadingdata-8.zip[8/10]ETA:1sDownloadingdata-9.zip[9/10]ETA:0s \ No newline at end of file +Downloaded10filesin4.7s.Downloadingdata-1.zip[1/10]ETA:0sDownloadingdata-2.zip[2/10]ETA:2sDownloadingdata-3.zip[3/10]ETA:2sDownloadingdata-4.zip[4/10]ETA:2sDownloadingdata-5.zip[5/10]ETA:2sDownloadingdata-6.zip[6/10]ETA:2sDownloadingdata-7.zip[7/10]ETA:1sDownloadingdata-8.zip[8/10]ETA:1sDownloadingdata-9.zip[9/10]ETA:0s \ No newline at end of file diff --git a/man/figures/progress-message.svg b/man/figures/progress-message.svg index 9e9a58326..2b046f210 100644 --- a/man/figures/progress-message.svg +++ b/man/figures/progress-message.svg @@ -1 +1 @@ -Taskthreeisunderway:step1Taskoneisrunning...Tasktwoisrunning...Taskthreeisunderway:step2Taskthreeisunderway:step3Taskthreeisunderway:step4Taskthreeisunderway:step5 \ No newline at end of file +Taskthreeisunderway:step1Taskoneisrunning...Tasktwoisrunning...Taskthreeisunderway:step2Taskthreeisunderway:step3Taskthreeisunderway:step4Taskthreeisunderway:step5 \ No newline at end of file diff --git a/man/figures/progress-natotal.svg b/man/figures/progress-natotal.svg index 8b9ebc4f1..5d3f9d636 100644 --- a/man/figures/progress-natotal.svg +++ b/man/figures/progress-natotal.svg @@ -1 +1 @@ -Parametertuning100done(27/s)|3.7sParametertuning1done(28/s)|36msParametertuning4done(28/s)|142msParametertuning10done(28/s)|354msParametertuning15done(28/s)|541msParametertuning21done(28/s)|758msParametertuning26done(28/s)|941msParametertuning32done(27/s)|1.2sParametertuning37done(28/s)|1.3sParametertuning43done(28/s)|1.6sParametertuning48done(28/s)|1.7sParametertuning54done(28/s)|2sParametertuning60done(28/s)|2.2sParametertuning65done(28/s)|2.3sParametertuning71done(28/s)|2.6sParametertuning77done(28/s)|2.8sParametertuning82done(28/s)|3sParametertuning87done(27/s)|3.2sParametertuning93done(27/s)|3.4sParametertuning98done(27/s)|3.6s \ No newline at end of file +Parametertuning100done(27/s)|3.7sParametertuning1done(28/s)|36msParametertuning4done(28/s)|146msParametertuning9done(27/s)|328msParametertuning15done(28/s)|535msParametertuning21done(28/s)|752msParametertuning27done(28/s)|968msParametertuning32done(28/s)|1.2sParametertuning38done(28/s)|1.4sParametertuning43done(28/s)|1.6sParametertuning49done(28/s)|1.8sParametertuning55done(28/s)|2sParametertuning60done(28/s)|2.2sParametertuning66done(28/s)|2.4sParametertuning72done(28/s)|2.6sParametertuning77done(28/s)|2.8sParametertuning82done(28/s)|3sParametertuning88done(28/s)|3.2sParametertuning93done(27/s)|3.4sParametertuning99done(27/s)|3.6s \ No newline at end of file diff --git a/man/figures/progress-output.svg b/man/figures/progress-output.svg index 71567a201..d29cb891b 100644 --- a/man/figures/progress-output.svg +++ b/man/figures/progress-output.svg @@ -1 +1 @@ -BeforetheprogressbarCalculating███████████████████████████████47%|ETA:2sAlreadyhalfway!Calculating███████████████████████████████100%|ETA:0sAlldoneCalculating██████████████████████████████1%|ETA:4sCalculating███████████████████████████████4%|ETA:4sCalculating███████████████████████████████9%|ETA:4sCalculating███████████████████████████████13%|ETA:4sCalculating███████████████████████████████17%|ETA:4sCalculating███████████████████████████████21%|ETA:4sCalculating███████████████████████████████26%|ETA:3sCalculating███████████████████████████████30%|ETA:3sCalculating███████████████████████████████34%|ETA:3sCalculating███████████████████████████████38%|ETA:3sCalculating███████████████████████████████43%|ETA:3sCalculating███████████████████████████████51%|ETA:2sCalculating███████████████████████████████56%|ETA:2sCalculating███████████████████████████████60%|ETA:2sCalculating███████████████████████████████64%|ETA:2sCalculating███████████████████████████████69%|ETA:1sCalculating███████████████████████████████73%|ETA:1sCalculating███████████████████████████████77%|ETA:1sCalculating███████████████████████████████81%|ETA:1sCalculating███████████████████████████████85%|ETA:1sCalculating███████████████████████████████90%|ETA:0sCalculating███████████████████████████████94%|ETA:0sCalculating██████████████████████████████98%|ETA:0s \ No newline at end of file +BeforetheprogressbarCalculating███████████████████████████████48%|ETA:2sAlreadyhalfway!Calculating███████████████████████████████100%|ETA:0sAlldoneCalculating██████████████████████████████1%|ETA:5sCalculating███████████████████████████████2%|ETA:5sCalculating███████████████████████████████6%|ETA:4sCalculating███████████████████████████████10%|ETA:4sCalculating███████████████████████████████15%|ETA:4sCalculating███████████████████████████████19%|ETA:4sCalculating███████████████████████████████23%|ETA:4sCalculating███████████████████████████████28%|ETA:3sCalculating███████████████████████████████32%|ETA:3sCalculating███████████████████████████████36%|ETA:3sCalculating███████████████████████████████40%|ETA:3sCalculating███████████████████████████████45%|ETA:3sCalculating███████████████████████████████53%|ETA:2sCalculating███████████████████████████████57%|ETA:2sCalculating███████████████████████████████61%|ETA:2sCalculating███████████████████████████████65%|ETA:2sCalculating███████████████████████████████70%|ETA:1sCalculating███████████████████████████████74%|ETA:1sCalculating███████████████████████████████78%|ETA:1sCalculating███████████████████████████████83%|ETA:1sCalculating███████████████████████████████87%|ETA:1sCalculating███████████████████████████████91%|ETA:0sCalculating███████████████████████████████95%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-output2.svg b/man/figures/progress-output2.svg index fb309f5b1..a19eeb72e 100644 --- a/man/figures/progress-output2.svg +++ b/man/figures/progress-output2.svg @@ -1 +1 @@ -BeforetheprogressbarCalculating███████████████████████████████47%|ETA:3sAlreadyhalfway!Calculating███████████████████████████████100%|ETA:0sAlldoneCalculating██████████████████████████████1%|ETA:4sCalculating███████████████████████████████4%|ETA:4sCalculating███████████████████████████████8%|ETA:4sCalculating███████████████████████████████12%|ETA:4sCalculating███████████████████████████████17%|ETA:4sCalculating███████████████████████████████21%|ETA:4sCalculating███████████████████████████████25%|ETA:4sCalculating███████████████████████████████29%|ETA:3sCalculating███████████████████████████████34%|ETA:3sCalculating███████████████████████████████38%|ETA:3sCalculating███████████████████████████████42%|ETA:3sCalculating███████████████████████████████51%|ETA:2sCalculating███████████████████████████████55%|ETA:2sCalculating███████████████████████████████59%|ETA:2sCalculating███████████████████████████████64%|ETA:2sCalculating███████████████████████████████68%|ETA:2sCalculating███████████████████████████████72%|ETA:1sCalculating███████████████████████████████76%|ETA:1sCalculating███████████████████████████████81%|ETA:1sCalculating███████████████████████████████85%|ETA:1sCalculating███████████████████████████████89%|ETA:1sCalculating███████████████████████████████93%|ETA:0sCalculating██████████████████████████████98%|ETA:0s \ No newline at end of file +BeforetheprogressbarCalculating███████████████████████████████50%|ETA:2sAlreadyhalfway!Calculating███████████████████████████████100%|ETA:0sAlldoneCalculating██████████████████████████████1%|ETA:5sCalculating███████████████████████████████2%|ETA:5sCalculating███████████████████████████████6%|ETA:4sCalculating███████████████████████████████11%|ETA:4sCalculating███████████████████████████████15%|ETA:4sCalculating███████████████████████████████19%|ETA:4sCalculating███████████████████████████████24%|ETA:4sCalculating███████████████████████████████28%|ETA:3sCalculating███████████████████████████████32%|ETA:3sCalculating███████████████████████████████37%|ETA:3sCalculating███████████████████████████████41%|ETA:3sCalculating███████████████████████████████46%|ETA:3sCalculating███████████████████████████████55%|ETA:2sCalculating███████████████████████████████59%|ETA:2sCalculating███████████████████████████████64%|ETA:2sCalculating███████████████████████████████68%|ETA:1sCalculating███████████████████████████████72%|ETA:1sCalculating███████████████████████████████76%|ETA:1sCalculating███████████████████████████████81%|ETA:1sCalculating███████████████████████████████85%|ETA:1sCalculating███████████████████████████████89%|ETA:1sCalculating███████████████████████████████93%|ETA:0sCalculating██████████████████████████████98%|ETA:0s \ No newline at end of file diff --git a/man/figures/progress-step-dynamic.svg b/man/figures/progress-step-dynamic.svg index db4f02edd..813f6ba78 100644 --- a/man/figures/progress-step-dynamic.svg +++ b/man/figures/progress-step-dynamic.svg @@ -1 +1 @@ -Downloadingdata,gotfile100/100[2.6s]Importingdata[1s]Cleaningdata[2s]FittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodel[3.5s]DownloadingdataDownloadingdata,gotfile2/100Downloadingdata,gotfile11/100Downloadingdata,gotfile19/100Downloadingdata,gotfile26/100Downloadingdata,gotfile34/100Downloadingdata,gotfile43/100Downloadingdata,gotfile50/100Downloadingdata,gotfile58/100Downloadingdata,gotfile66/100Downloadingdata,gotfile74/100Downloadingdata,gotfile82/100Downloadingdata,gotfile90/100Downloadingdata,gotfile98/100ImportingdataCleaningdataFittingmodelFittingmodel \ No newline at end of file +Downloadingdata,gotfile100/100[2.6s]Importingdata[1s]Cleaningdata[2s]FittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodel[3.5s]DownloadingdataDownloadingdata,gotfile7/100Downloadingdata,gotfile15/100Downloadingdata,gotfile22/100Downloadingdata,gotfile30/100Downloadingdata,gotfile38/100Downloadingdata,gotfile46/100Downloadingdata,gotfile54/100Downloadingdata,gotfile62/100Downloadingdata,gotfile69/100Downloadingdata,gotfile76/100Downloadingdata,gotfile84/100Downloadingdata,gotfile92/100Downloadingdata,gotfile100/100ImportingdataCleaningdataFittingmodelFittingmodel \ No newline at end of file diff --git a/man/figures/progress-step-msg.svg b/man/figures/progress-step-msg.svg index 299e3b65c..66449e2f7 100644 --- a/man/figures/progress-step-msg.svg +++ b/man/figures/progress-step-msg.svg @@ -1 +1 @@ -Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloaded819.20kB.[3.5s]Downloadingdata.Downloadingdata. \ No newline at end of file +Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloadingdata.Downloaded819.20kB.[3.5s]Downloadingdata.Downloadingdata. \ No newline at end of file diff --git a/man/figures/progress-step-spin.svg b/man/figures/progress-step-spin.svg index 6125f4f09..019e2b2ca 100644 --- a/man/figures/progress-step-spin.svg +++ b/man/figures/progress-step-spin.svg @@ -1 +1 @@ -DownloadingdataDownloadingdataDownloadingdataDownloadingdata[2.4s]Importingdata[1s]Cleaningdata[2s]FittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodel[3.5s]DownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataImportingdataCleaningdataFittingmodelFittingmodel \ No newline at end of file +DownloadingdataDownloadingdataDownloadingdataDownloadingdata[2.5s]Importingdata[1s]Cleaningdata[2s]FittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodel[3.4s]DownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataImportingdataCleaningdataFittingmodelFittingmodel \ No newline at end of file diff --git a/man/figures/progress-step.svg b/man/figures/progress-step.svg index 6b2f4046c..77bcce08c 100644 --- a/man/figures/progress-step.svg +++ b/man/figures/progress-step.svg @@ -1 +1 @@ -Downloadingdata[2s]Importingdata[1s]Cleaningdata[2s]Fittingmodel[3s]DownloadingdataImportingdataCleaningdataFittingmodel \ No newline at end of file +Downloadingdata[2s]Importingdata[1s]Cleaningdata[2s]Fittingmodel[3s]DownloadingdataImportingdataCleaningdataFittingmodel \ No newline at end of file diff --git a/man/figures/progress-tasks.svg b/man/figures/progress-tasks.svg index baa911a5f..0afb100fa 100644 --- a/man/figures/progress-tasks.svg +++ b/man/figures/progress-tasks.svg @@ -1 +1 @@ -3/3ETA:0s|Tasks1/3ETA:2s|Tasks2/3ETA:1s|Tasks \ No newline at end of file +3/3ETA:0s|Tasks1/3ETA:2s|Tasks2/3ETA:1s|Tasks \ No newline at end of file diff --git a/man/format_error.Rd b/man/format_error.Rd index 4ddc8d936..b09790fba 100644 --- a/man/format_error.Rd +++ b/man/format_error.Rd @@ -52,3 +52,30 @@ stop(format_error(c( }} } +\seealso{ +These functions support \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_inline}()} +} +\concept{functions supporting inline markup} diff --git a/man/format_inline.Rd b/man/format_inline.Rd index d2ad106b2..673f82d1d 100644 --- a/man/format_inline.Rd +++ b/man/format_inline.Rd @@ -35,3 +35,30 @@ it to the screen. It uses \code{\link[=cli_text]{cli_text()}} internally. \examples{ format_inline("A message for {.emph later}, thanks {.fn format_inline}.") } +\seealso{ +This function supports \link[=inline-markup]{inline markup}. + +Other functions supporting inline markup: +\code{\link{cli_abort}()}, +\code{\link{cli_alert}()}, +\code{\link{cli_blockquote}()}, +\code{\link{cli_bullets_raw}()}, +\code{\link{cli_bullets}()}, +\code{\link{cli_dl}()}, +\code{\link{cli_h1}()}, +\code{\link{cli_li}()}, +\code{\link{cli_ol}()}, +\code{\link{cli_process_start}()}, +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_rule}}, +\code{\link{cli_status_update}()}, +\code{\link{cli_status}()}, +\code{\link{cli_text}()}, +\code{\link{cli_ul}()}, +\code{\link{format_error}()} +} +\concept{functions supporting inline markup} diff --git a/man/hash_animal.Rd b/man/hash_animal.Rd index 81f2fb7ea..de61abd3a 100644 --- a/man/hash_animal.Rd +++ b/man/hash_animal.Rd @@ -15,7 +15,7 @@ hash_obj_animal(x, n_adj = 2, serialize_version = 2) \arguments{ \item{x}{Character vector. \code{NA} entries will have an \code{NA} hash.} -\item{n_adj}{Number of adjectives to use. It must be between 0 and 3.} +\item{n_adj}{Number of adjectives to use. It must be from 0 through 3.} \item{serialize_version}{Workspace format version to use, see \code{\link[base:serialize]{base::serialize()}}.} @@ -44,7 +44,7 @@ hash of the input, and converts them into an adjective-animal form to create a human readable hash. \subsection{Number of possible hash values}{ -\code{hash_animals()} uses 1748 animal names and +\code{hash_animal()} uses 1748 animal names and 8946 different adjectives. The number of different hashes you can get for different values of \code{n_adj}:\tabular{rr}{ \code{n_adj} \tab size of the hash table space \cr @@ -64,7 +64,7 @@ and in turn from from \url{https://gfycat.com}. } -\code{hash_raw_anima()} calculates the adjective-animal hash of +\code{hash_raw_animal()} calculates the adjective-animal hash of the bytes of a raw vector. \code{hash_obj_animal()} calculates the adjective-animal hash of diff --git a/man/hash_emoji.Rd b/man/hash_emoji.Rd index c1494e0e3..86b6b073f 100644 --- a/man/hash_emoji.Rd +++ b/man/hash_emoji.Rd @@ -16,7 +16,7 @@ hash_obj_emoji(x, size = 3, serialize_version = 2) \item{x}{Character vector. \code{NA} entries will have an \code{NA} hash.} \item{size}{Number of emojis to use in a hash. Currently it has to -be between 1 and 4.} +be from 1 through 4.} \item{serialize_version}{Workspace format version to use, see \code{\link[base:serialize]{base::serialize()}}.} diff --git a/man/hash_md5.Rd b/man/hash_md5.Rd index 686fe6ff7..5c766d3ac 100644 --- a/man/hash_md5.Rd +++ b/man/hash_md5.Rd @@ -43,7 +43,7 @@ of a raw vector. \code{hash_obj_md5()} calculates the MD5 hash of an R object. The object is serialized into a binary vector first. -\code{hash_file_md5()} calcultaes the MD5 hash of one of more +\code{hash_file_md5()} calculates the MD5 hash of one or more files. } \examples{ diff --git a/man/hash_sha1.Rd b/man/hash_sha1.Rd index 405aff071..cda5b6183 100644 --- a/man/hash_sha1.Rd +++ b/man/hash_sha1.Rd @@ -26,7 +26,7 @@ will have an \code{NA} hash.} \item{paths}{Character vector of file names.} } \value{ -\code{hash_sha1()} returns aharacter vector of hexadecimal +\code{hash_sha1()} returns a character vector of hexadecimal SHA-1 hashes. \code{hash_raw_sha1()} returns a character scalar. diff --git a/man/hash_sha256.Rd b/man/hash_sha256.Rd index d90d569a2..959781770 100644 --- a/man/hash_sha256.Rd +++ b/man/hash_sha256.Rd @@ -26,7 +26,7 @@ will have an \code{NA} hash.} \item{paths}{Character vector of file names.} } \value{ -\code{hash_sha256()} returns aharacter vector of hexadecimal +\code{hash_sha256()} returns a character vector of hexadecimal SHA-256 hashes. \code{hash_raw_sha256()} returns a character scalar. diff --git a/man/inline-markup.Rd b/man/inline-markup.Rd index 9b265e0d5..d328e3573 100644 --- a/man/inline-markup.Rd +++ b/man/inline-markup.Rd @@ -4,7 +4,8 @@ \alias{inline-markup} \title{About inline markup in the semantic cli} \description{ -About inline markup in the semantic cli +To learn how to use cli’s semantic markup, start with the ‘Building +a semantic CLI’ article at \url{https://cli.r-lib.org}. } \section{Command substitution}{ @@ -66,26 +67,26 @@ The default theme defines the following inline classes: \item \code{email} for an email address. If the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), then cli creates a clickable link. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{emph} for emphasized text. \item \code{envvar} for the name of an environment variable. \item \code{field} for a generic field, e.g. in a named list. \item \code{file} for a file name. If the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), then cli creates a clickable link that opens the file in RStudio or with the default app for the file type. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{fun} for a function name. If it is in the \code{package::function_name} form, and the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), then cli creates a clickable link. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{help} is a help page of a \emph{function}. If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio), then cli creates a clickable link. It supports link text. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{href} creates a hyperlink, potentially with a link text. If the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), then cli creates a clickable link. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{key} for a keyboard key. \item \code{obj_type_friendly} formats the type of an R object in a readable way, and it should be used with \code{{}}, see an example below. @@ -95,23 +96,23 @@ collapsed vectors (see below) from "and" to "or". \item \code{pkg} for a package name. \item \code{run} is an R expression, that is potentially clickable if the terminal supports ANSI hyperlinks to runnable code (e.g. RStudio). -It supports link text. See \link{links} for more about cli hyperlinks. -\item \code{strong} for strong importance. -\item \code{topic} is a help page of a \emph{ropic}. +It supports link text. See \link{links} for more information about cli hyperlinks. +\item \code{str} for a double quoted string escaped by \code{\link[base:encodeString]{base::encodeString()}}.#' * \code{strong} for strong importance. +\item \code{topic} is a help page of a \emph{topic}. If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio), then cli creates a clickable link. It supports link text. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{type} formats the type of an R object in a readable way, and it should be used with \code{{}}, see an example below. \item \code{url} for a URL. If the terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), then cli creates a clickable link. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. \item \code{var} for a variable name. \item \code{val} for a generic "value". \item \code{vignette} is a vignette. If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio), then cli creates a clickable link. It supports link text. -See \link{links} for more about cli hyperlinks. +See \link{links} for more information about cli hyperlinks. } \if{html}{\out{
}}\preformatted{ul <- cli_ul() @@ -266,11 +267,12 @@ All cli commands that emit text support pluralization. Some examples: \if{html}{\out{
}}\preformatted{ndirs <- 1 nfiles <- 13 -cli_alert_info("Found \{ndirs\} diretor\{?y/ies\} and \{nfiles\} file\{?s\}.") +pkgs <- c("pkg1", "pkg2", "pkg3") +cli_alert_info("Found \{ndirs\} director\{?y/ies\} and \{nfiles\} file\{?s\}.") cli_text("Will install \{length(pkgs)\} package\{?s\}: \{.pkg \{pkgs\}\}") }\if{html}{\out{
}}\if{html}{\out{
-#>  Found 1 diretory and 13 files.                                                
+#>  Found 1 directory and 13 files.                                               
 #> Will install 3 packages: pkg1, pkg2, and pkg3                                   
 
}} diff --git a/man/links.Rd b/man/links.Rd index 73dff4966..7f368a6ea 100644 --- a/man/links.Rd +++ b/man/links.Rd @@ -310,7 +310,7 @@ needs to qualify packages with \code{::}, but you might not want to show this: \subsection{Security considerations}{ -To make \code{.run} hyperlinks more secure, RStudio with not run code +To make \code{.run} hyperlinks more secure, RStudio will not run code \itemize{ \item that is not in the \code{pkg::fun(args)} form, \item if \code{args} contains \code{(}, \verb{)} or \verb{;}, @@ -318,6 +318,12 @@ To make \code{.run} hyperlinks more secure, RStudio with not run code \item if it calls a package that is not loaded, and it is not one of testthat, devtools, usethis, or rlang, which are explicitly allowed. } + +When RStudio does not run a \code{.run} hyperlink, then it shows the code +and the user can copy and paste it to the console, if they consider +it safe to run. + +Note that depending on your version of RStudio, the behavior can change. } } diff --git a/man/num_ansi_colors.Rd b/man/num_ansi_colors.Rd index 5bb3d044c..90f3e4936 100644 --- a/man/num_ansi_colors.Rd +++ b/man/num_ansi_colors.Rd @@ -62,6 +62,7 @@ be actually used, but there is no easy way to tell that.) active sink for it, then 1L is returned. (If a sink is active for "output", then R changes the \code{stdout()} stream, so this check is not needed.) +\item If the \code{cli.default_num_colors} option is set, then we use that. \item If R is running inside RGui on Windows, or R.app on macOS, then we return 1L. \item If R is running inside RStudio, with color support, then the diff --git a/man/progress-utils.Rd b/man/progress-utils.Rd index d811f34d4..d9a2a3f75 100644 --- a/man/progress-utils.Rd +++ b/man/progress-utils.Rd @@ -25,4 +25,15 @@ bars created in C/C++ code.) \code{cli_progress_cleanup()} terminates all active progress bars. (It currently ignores progress bars created in the C/C++ code.) } -\concept{progress bar} +\seealso{ +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()}, +\code{\link{progress-variables}} +} +\concept{progress bar functions} diff --git a/man/progress-variables.Rd b/man/progress-variables.Rd index cb95f1294..2d2236466 100644 --- a/man/progress-variables.Rd +++ b/man/progress-variables.Rd @@ -424,3 +424,15 @@ bytes, in a human readable format. } } +\seealso{ +Other progress bar functions: +\code{\link{cli_progress_along}()}, +\code{\link{cli_progress_bar}()}, +\code{\link{cli_progress_builtin_handlers}()}, +\code{\link{cli_progress_message}()}, +\code{\link{cli_progress_num}()}, +\code{\link{cli_progress_output}()}, +\code{\link{cli_progress_step}()}, +\code{\link{cli_progress_styles}()} +} +\concept{progress bar functions} diff --git a/tests/testthat/_snaps/1.0.6/rlang-errors.md b/tests/testthat/_snaps/1.0.6/rlang-errors.md deleted file mode 100644 index 801363b89..000000000 --- a/tests/testthat/_snaps/1.0.6/rlang-errors.md +++ /dev/null @@ -1,10 +0,0 @@ -# cli_abort(.internal = TRUE) reports the correct function (r-lib/rlang#1386) - - Code - (expect_error(fn())) - Output - - Error in `fn()`: - ! Message. - i This is an internal error that was detected in the base package. - diff --git a/tests/testthat/_snaps/rlang-1.1.0/rlang-errors.md b/tests/testthat/_snaps/rlang-1.1.0/rlang-errors.md new file mode 100644 index 000000000..5251a8637 --- /dev/null +++ b/tests/testthat/_snaps/rlang-1.1.0/rlang-errors.md @@ -0,0 +1,54 @@ +# cli_abort() captures correct call and backtrace + + Code + print(expect_error(f())) + Output + + Error in `h()`: + ! foo + --- + Backtrace: + x + 1. +-base::print(expect_error(f())) + 2. +-testthat::expect_error(f()) + 3. | \-testthat:::expect_condition_matching(...) + 4. | \-testthat:::quasi_capture(...) + 5. | +-testthat (local) .capture(...) + 6. | | \-base::withCallingHandlers(...) + 7. | \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) + 8. \-cli (local) f() + 9. \-cli (local) g() + 10. \-cli (local) h() + +--- + + Code + print(expect_error(f(list()))) + Output + + Error in `h()`: + ! `x` can't be empty. + --- + Backtrace: + x + 1. +-base::print(expect_error(f(list()))) + 2. +-testthat::expect_error(f(list())) + 3. | \-testthat:::expect_condition_matching(...) + 4. | \-testthat:::quasi_capture(...) + 5. | +-testthat (local) .capture(...) + 6. | | \-base::withCallingHandlers(...) + 7. | \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) + 8. \-cli (local) f(list()) + 9. \-cli (local) g(x) + 10. \-cli (local) h(x) + +# cli_abort(.internal = TRUE) reports the correct function (r-lib/rlang#1386) + + Code + (expect_error(fn())) + Output + + Error in `fn()`: + ! Message. + i This is an internal error that was detected in the base package. + diff --git a/tests/testthat/_snaps/rlang-errors.md b/tests/testthat/_snaps/rlang-errors.md index ab4b368db..30e40e77e 100644 --- a/tests/testthat/_snaps/rlang-errors.md +++ b/tests/testthat/_snaps/rlang-errors.md @@ -369,33 +369,3 @@ Output color me interested -# cli_abort() captures correct call and backtrace - - Code - print(expect_error(f())) - Output - - Error in `h()`: - ! foo - --- - Backtrace: - 1. base::print(expect_error(f())) - 8. cli (local) f() - 9. cli (local) g() - 10. cli (local) h() - ---- - - Code - print(expect_error(f(list()))) - Output - - Error in `h()`: - ! `x` can't be empty. - --- - Backtrace: - 1. base::print(expect_error(f(list()))) - 8. cli (local) f(list()) - 9. cli (local) g(x) - 10. cli (local) h(x) - diff --git a/tests/testthat/test-ansi-hyperlink.R b/tests/testthat/test-ansi-hyperlink.R index 5edf22c2f..ba28798a9 100644 --- a/tests/testthat/test-ansi-hyperlink.R +++ b/tests/testthat/test-ansi-hyperlink.R @@ -286,25 +286,11 @@ test_that("ansi_has_hyperlink_support", { ) # if no ansi support, then no - withr::with_options(list(cli.num_colors = 1), - expect_false(ansi_has_hyperlink_support()) - ) - withr::with_envvar(list(R_CLI_NUM_COLORS = "1"), - expect_false(ansi_has_hyperlink_support()) - ) - withr::with_options(list(crayon.enabled = FALSE), - expect_false(ansi_has_hyperlink_support()) - ) - withr::with_envvar(list(NO_COLOR = "true"), - expect_false(ansi_has_hyperlink_support()) - ) - - # rstudio env var - withr::with_envvar(list(RSTUDIO_CLI_HYPERLINKS = "true"), - expect_true(ansi_has_hyperlink_support()) - ) + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) + expect_false(ansi_has_hyperlink_support()) # are we in rstudio with support? + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) mockery::stub(ansi_has_hyperlink_support, "rstudio_detect", list(type = "rstudio_console", hyperlink = TRUE)) expect_true(ansi_has_hyperlink_support()) @@ -312,6 +298,7 @@ test_that("ansi_has_hyperlink_support", { test_that("ansi_has_hyperlink_support 2", { local_clean_cli_context() + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) mockery::stub(ansi_has_hyperlink_support, "isatty", FALSE) expect_false(ansi_has_hyperlink_support()) @@ -319,6 +306,7 @@ test_that("ansi_has_hyperlink_support 2", { test_that("ansi_has_hyperlink_support 3", { local_clean_cli_context() + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) mockery::stub(ansi_has_hyperlink_support, "isatty", TRUE) mockery::stub(ansi_has_hyperlink_support, "is_windows", TRUE) @@ -328,6 +316,7 @@ test_that("ansi_has_hyperlink_support 3", { test_that("ansi_has_hyperlink_support 4", { local_clean_cli_context() + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) mockery::stub(ansi_has_hyperlink_support, "isatty", TRUE) withr::local_envvar("CI" = "true") @@ -339,6 +328,7 @@ test_that("ansi_has_hyperlink_support 4", { test_that("ansi_has_hyperlink_support 5", { local_clean_cli_context() + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) mockery::stub(ansi_has_hyperlink_support, "isatty", TRUE) withr::local_envvar( @@ -350,6 +340,7 @@ test_that("ansi_has_hyperlink_support 5", { test_that("ansi_has_hyperlink_support 5", { local_clean_cli_context() + mockery::stub(ansi_has_hyperlink_support, "num_ansi_colors", 256L) mockery::stub(ansi_has_hyperlink_support, "isatty", TRUE) withr::local_envvar(VTE_VERSION = "0.51.1") diff --git a/tests/testthat/test-rlang-errors.R b/tests/testthat/test-rlang-errors.R index 80686a002..d92c436ef 100644 --- a/tests/testthat/test-rlang-errors.R +++ b/tests/testthat/test-rlang-errors.R @@ -133,6 +133,7 @@ test_that_cli(config = "ansi", "update_rstudio_color", { }) test_that("cli_abort() captures correct call and backtrace", { + skip_on_cran() rlang::local_options( rlang_trace_top_env = environment(), rlang_trace_format_srcrefs = FALSE @@ -144,7 +145,7 @@ test_that("cli_abort() captures correct call and backtrace", { expect_snapshot({ print(expect_error(f())) - }) + }, variant = paste0("rlang-", packageVersion("rlang"))) classed_stop <- function(message, env = parent.frame()) { cli::cli_abort( @@ -164,10 +165,11 @@ test_that("cli_abort() captures correct call and backtrace", { expect_snapshot({ print(expect_error(f(list()))) - }) + }, variant = paste0("rlang-", packageVersion("rlang"))) }) test_that("cli_abort(.internal = TRUE) reports the correct function (r-lib/rlang#1386)", { + skip_on_cran() fn <- function() { cli::cli_abort("Message.", .internal = TRUE) } @@ -176,5 +178,5 @@ test_that("cli_abort(.internal = TRUE) reports the correct function (r-lib/rlang # Should mention an internal error in the `base` package expect_snapshot({ (expect_error(fn())) - }, variant = as.character(packageVersion("rlang"))) + }, variant = paste0("rlang-", packageVersion("rlang"))) }) diff --git a/vignettes/cli-config-user.Rmd b/vignettes/cli-config-user.Rmd index 1a1e34d0a..6dfe66c3d 100644 --- a/vignettes/cli-config-user.Rmd +++ b/vignettes/cli-config-user.Rmd @@ -79,9 +79,21 @@ See ### `cli.default_num_colors` -Default number of ANSI colors. This value is only used if ANSI color support -is detected. You can set this value to keep relying on auto-detection, -but to adjust the number of colors when cli detects color support. +Default number of ANSI colors. This value is used if the number of colors +is not already set by +* the `cli.num_colors` option, +* the `R_CLI_NUM_COLORS` environment variable, +* the `crayon.enabled` and `crayon.colors` options, +* the `NO_COLOR` environment variable, +* the `knitr.in.progress` option, +* a `sink()` call for the stream. + +You can also use this option if color support is detected correctly, but +you want to adjust the number of colors. E.g. +* if `crayon.enabled` is `TRUE`, but `crayon.colors` is not, +* in Emacs on Windows, +* in terminals. + See [num_ansi_colors()]. See also the `cli.num_colors` option. ### `cli.dynamic` diff --git a/vignettes/usethis-ui.Rmd b/vignettes/usethis-ui.Rmd index 9401f60d9..97aca7dcc 100644 --- a/vignettes/usethis-ui.Rmd +++ b/vignettes/usethis-ui.Rmd @@ -291,10 +291,10 @@ ui_stop("Could not copy {ui_path(img)} to {ui_path(logo_path)}, file already ex `cli_abort()` does the same and is formatted using `cli_bullets()`. ```{asciicast} -cli_abort( +cli_abort(c( "Could not copy {.file {img}} to {.file {logo_path}}, file already exists", "i" = "You can set {.arg overwrite = TRUE} to avoid this error" - ) + )) ``` ## `usethis::ui_todo()` @@ -360,10 +360,10 @@ ui_warn("Could not copy {ui_path(img)} to {ui_path(logo_path)}, file already ex `cli_warn()` does the same and is formatted using `cli_bullets()`. ```{asciicast} -cli_warn( +cli_warn(c( "Could not copy {.file {img}} to {.file {logo_path}}, file already exists", "i" = "You can set {.arg overwrite = TRUE} to avoid this warning" - ) + )) ``` ## `usethis::ui_yeah()`