Skip to contents

Returns a predefined Markdown snippet.

Usage

md_snip(id = data_md_snips$id, ...)

Arguments

id

Snippet identifier. One of "opt_global_max_cache_age", "pkg_config", "pkg_required", "pkgdown_notice", "rstudio_addin_hint" or "usage_notice".

...

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.

Value

A character scalar.

Details

Currently, the following Markdown snippets are available:

idarguments
opt_global_max_cache_age
pkg_configpkg
pkg_requiredpkg
pkgdown_notice
rstudio_addin_hint
usage_notice

See also

Markdown snippet functions data_md_snips

Examples

pkgsnip::md_snip(id = "rstudio_addin_hint") |> cat()
#> This function is also 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: