Adds or updates bibliography information in a boilerplate database.
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)
# Add bibliography
# Using the example bibliography included with the package
example_bib <- system.file("extdata", "example_references.bib", package = "boilerplate")
db <- boilerplate_add_bibliography(
db,
url = paste0("file://", example_bib),
local_path = "references.bib"
)
#> ✔ Bibliography information added to database
#> ℹ URL: file:///private/var/folders/q9/lkcn14l97mb6mkhbxsxrpr4w0000gn/T/RtmpIJ7HAJ/temp_libpatha1e52c8210df/boilerplate/extdata/example_references.bib
#> ℹ Local path: references.bib
# Save the updated database
boilerplate_save(db, data_path = temp_dir, confirm = FALSE, quiet = TRUE)
# Clean up
unlink(temp_dir, recursive = TRUE)
# }