style_hyperlink {cli}R Documentation

Terminal Hyperlinks

Description

Terminal Hyperlinks

Usage

style_hyperlink(text, url)

ansi_has_hyperlink_support()

Arguments

text

Text to show. text and url are recycled to match their length, via a paste0() call.

url

URL to link to.

Details

ansi_hyperlink() creates an ANSI hyperlink.

ansi_has_hyperlink_support() checks if the current stdout() supports hyperlinks.

See also https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda.

Value

Styled ansi_string for style_hyperlink(). Logical scalar for ansi_has_hyperlink_support().

Examples

cat("This is an", style_hyperlink("R", "https://r-project.org"), "link.\n")
ansi_has_hyperlink_support()

[Package cli version 3.0.1 Index]