# The authors of the package, without contributors
author <- eval(str2lang(meta$`Authors@R`))
author <- author[vapply(
  author, function(e) "aut" %in% e$role, logical(1)
)]

# DESCRIPTION has no Date field, so take the year CRAN stamps on release and
# fall back to the current year for a development install.
year <- sub("-.*", "", meta$`Date/Publication`)
if (!length(year) || !nzchar(year)) {
  year <- format(Sys.Date(), "%Y")
}

bibentry(
  bibtype = "Manual",
  title   = paste0(meta$Package, ": ", gsub("[[:space:]]+", " ", meta$Title)),
  author  = author,
  year    = year,
  doi     = "10.5281/zenodo.14213017"
)
