Returns a predefined Markdown snippet.
Arguments
- id
Snippet identifier. One of
"opt_global_max_cache_age"
,"pkg_config"
,"pkg_required"
,"pkg_usage"
,"pkgdown_site"
or"rstudio_addin"
.- ...
Further named arguments used to tailor the snippet to your needs. Not all snippets require additional arguments, see
data_md_snips
for an overview. If a required argument is not explicitly provided, it is searched for in the parent frames.
Details
Currently, the following Markdown snippets are available:
id | arguments |
opt_global_max_cache_age | |
pkg_config | pkg |
pkg_required | pkg |
pkg_usage | |
pkgdown_site | |
rstudio_addin |
See also
Markdown snippet functions
data_md_snips
Examples
pkgsnip::md_snip(id = "rstudio_addin") |> cat()
#> This function is registered as an [RStudio add-in](https://rstudio.github.io/rstudioaddins/), allowing RStudio users to assign a [custom shortcut](https://support.rstudio.com/hc/en-us/articles/206382178-Customizing-Keyboard-Shortcuts-in-the-RStudio-IDE) to it and to invoke it from the [command palette](https://www.rstudio.com/blog/rstudio-1-4-a-quick-tour/#command-palette--shortcuts).
# certain snips require additional args
pkgsnip::md_snip(id = "pkg_config",
pkg = "foo") |>
cat()
#> Some of foo's functionality is controlled via package-specific global configuration which can either be set via [R options](https://rdrr.io/r/base/options.html) or [environment variables](https://en.wikipedia.org/wiki/Environment_variable) (the former take precedence). This configuration includes: