Skip to contents

Copies the bibliography file from cache to a specified directory, typically for use with Quarto documents.

Usage

boilerplate_copy_bibliography(
  db,
  target_dir = ".",
  overwrite = TRUE,
  update_first = FALSE,
  quiet = FALSE
)

Arguments

db

Database object containing bibliography information

target_dir

Directory to copy the bibliography file to. Default is current directory.

overwrite

Logical. Whether to overwrite existing file

update_first

Logical. Whether to update from remote before copying

quiet

Logical. Suppress messages

Value

Path to the copied bibliography file, or NULL if operation failed

Examples

# \donttest{
# Create temporary directory for example
temp_dir <- tempfile()
dir.create(temp_dir)

# Initialise and import
boilerplate_init(data_path = temp_dir, create_dirs = TRUE, confirm = FALSE, quiet = TRUE)
db <- boilerplate_import(data_path = temp_dir, quiet = TRUE)

# Copy bibliography
boilerplate_copy_bibliography(db, temp_dir)
#> Migrated bibliography cache from old location to /Users/joseph/Library/Caches/org.R-project.R/R/boilerplate
#>  No bibliography URL specified in database

# Clean up
unlink(temp_dir, recursive = TRUE)
# }