GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cli
  • FAQ
  • Reference
  • Building a Semantic CLI
  • From usethis::ui functions to cli
  • cli pluralization
  • Introduction to progress bars in cli
  • Advanced cli progress bars
  • cli color palettes
  • More articles...
  • Changelog

This view

  • Original page
  • New address

GeezerVison is showing cli.r-lib.org — Terminal Hyperlinks — style_hyperlink

Terminal Hyperlinks

Source: R/ansi-hyperlink.R
style_hyperlink.Rd

ansi_hyperlink() creates an ANSI hyperlink.

Usage

style_hyperlink(text, url, params = NULL)

ansi_has_hyperlink_support()

ansi_hyperlink_types()

Arguments

text

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

url

URL to link to.

params

A named character vector of additional parameters, or NULL.

Value

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

Details

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.

Examples

cat("This is an", style_hyperlink("R", "https://r-project.org"), "link.\n")
#> This is an R link.
ansi_has_hyperlink_support()
#> [1] FALSE
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.