ansi_hyperlink()
creates an ANSI hyperlink.
style_hyperlink(text, url, params = NULL)
ansi_has_hyperlink_support()
ansi_hyperlink_types()
Text to show. text
and url
are recycled to match their
length, via a paste0()
call.
URL to link to.
A named character vector of additional parameters, or NULL
.
Styled cli_ansi_string
for style_hyperlink()
.
Logical scalar for ansi_has_hyperlink_support()
.
This function is currently experimental. In particular, many of the
ansi_*()
functions do not support it properly.
ansi_has_hyperlink_support()
checks if the current stdout()
supports hyperlinks.
See also https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda.
ansi_hyperlink_types()
checks if current stdout()
supports various
types of hyperlinks. It returns a list with entries href
, run
,
help
and vignettes
.
cat("This is an", style_hyperlink("R", "https://r-project.org"), "link.\n")
#> This is an R link.
ansi_has_hyperlink_support()
#> [1] FALSE