Skip to contents

Downloads and caches a bibliography file from a remote URL specified in the database.

Usage

boilerplate_update_bibliography(
  db,
  cache_dir = NULL,
  force = FALSE,
  quiet = FALSE
)

Arguments

db

Database object containing bibliography information

cache_dir

Directory to cache the bibliography file. Default uses tools::R_user_dir("boilerplate", "cache")

force

Logical. Force re-download even if cached file exists

quiet

Logical. Suppress messages

Value

Path to the local bibliography file, or NULL if no bibliography specified

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)

# Update bibliography
bib_file <- boilerplate_update_bibliography(db)
#> 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)
# }