Setup automatic linking
Arguments
- type
"plain" for plain links, "tooltip" for adding a tooltip
- keep_braces
Should the braces be kept ?
- keep_pkg_prefix
Should the package prefix be kept ?
- pkg
package name
- ...
See
bslib::tooltip()
- call
Function call of the form
pkg::fun()
Examples
if (FALSE) {
# auto is mostly meant to be called inside rmarkdown or quarto documents
auto()
auto(keep_braces = FALSE, keep_pkg_prefix = FALSE)
# manually generate the tooltips for {pkg} and pkg::fun()
link::to_pkg("tidyverse")
link::to_pkg("tidyverse")
link::to_call("dplyr::summarise()")
link::to_call("dplyr::summarise()")
}
link::to_pkg("tidyverse", type = "plain")
#> <a href="https://tidyverse.tidyverse.org" class="r-link-pkg" target="_blank">{tidyverse}</a>
link::to_call("dplyr::summarise()", type = "plain")
#> <span class="r-link-pkg-error">dplyr::summarise()</span>