Skip to contents

Recursively copies markdown files from a source directory to a destination directory while skipping excluded directories such as build outputs or git metadata. Existing files are only overwritten when requested.

Usage

copy_markdown(
  src = ".",
  dst,
  overwrite = TRUE,
  keep_md = FALSE,
  exclude = c("_site", ".quarto", ".git", ".targets", "_freeze", ".Rproj.user",
    ".vscode")
)

Arguments

src

Character scalar. Source directory to scan for markdown files. Defaults to the current working directory.

dst

Character scalar. Destination directory where markdown files will be copied.

overwrite

Logical scalar. Whether to overwrite existing files in the destination when the source file is newer. Defaults to TRUE.

keep_md

Logical scalar. Whether to keep the original markdown files that have the `.html.md` extension. Defaults to FALSE, which deletes these files after copying.

exclude

Character vector. Directory names to skip when scanning for markdown files. Defaults to common build and editor directories.

Value

Invisible character vector of relative paths copied to the destination directory.

Examples

if (FALSE) { # \dontrun{
copy_markdown(src = "./docs", dst = "./site-docs")
} # }