Designed for inline use in R Markdown, e.g. "r provide_file("attachment.pdf")"
Usage
provide_file(
path,
label = basename(path),
mime = NULL,
download = TRUE,
warn_size_mb = 5
)Details
The function reads a local file, encodes it as Base64, and returns an tag with a data: URI. This allows the file to be embedded directly into the rendered output instead of being referenced externally.