year <- if (!is.null(meta$`Date/Publication`)) {
  sub("-.*", "", meta$`Date/Publication`)
} else {
  format(Sys.Date(), "%Y")
}

title <- sprintf("specr: Conducting and Visualizing Specification Curve Analyses (Version %s)", meta$Version)

bibentry(
  bibtype = "misc",
  key = "specr",
  title = title,
  author = c(person("Philipp K.", "Masur"), person("Michael", "Scharkow")),
  year = year,
  url = "https://CRAN.R-project.org/package=specr",
  textVersion = paste0(
    "Masur, P. K., & Scharkow, M. (", year, "). specr: Conducting and Visualizing ",
    "Specification Curve Analyses (Version ", meta$Version, "). ",
    "https://CRAN.R-project.org/package=specr"
  ),
  mheader = "To cite 'specr' in publications use:"
)
