# "meta" isn't defined here but made available by R CMD check

authors <- eval(parse(text = meta$`Authors@R`))
authors <- Filter(function(p) "aut" %in% p$role, authors)

citHeader("To cite palaeoverse in publications, please cite both the article describing the package and the package itself:")

bibentry(bibtype = "Article",
         title = "palaeoverse: A community-driven R package to support palaeobiological analysis",
         author = c(as.person("Lewis A. Jones"),
                    as.person("William Gearty"),
                    as.person("Bethany J. Allen"),
                    as.person("Kilian Eichenseer"),
                    as.person("Christopher D. Dean"),
                    as.person("Sofía Galván"),
                    as.person("Miranta Kouvari"),
                    as.person("Pedro L. Godoy"),
                    as.person("Cecily S. C. Nicholl"),
                    as.person("Lucas Buffan"),
                    as.person("Erin M. Dillon"),
                    as.person("Joseph T. Flannery-Sutherland"),
                    as.person("Alfio Alessandro Chiarenza")),
         year = "2023",
         journal = "Methods in Ecology and Evolution",
         volume = "14(9)",
         pages = "2205--2215",
         doi = "10.1111/2041-210X.14099",
         textVersion = paste("Jones, L.A., Gearty, W., Allen, B.J., Eichenseer, K., Dean, C.D., Galván S., Kouvari, M., Godoy, P.L., Nicholl, C.S.C., Buffan, L., Dillon, E.M., Flannery-Sutherland, J.T., Chiarenza, A.A. 2023.",
         "palaeoverse: A community-driven R package to support palaeobiological analysis.",
         "Methods in Ecology and Evolution.",
         "14(9), 2205--2215.",
         "doi: 10.1111/2041-210X.14099")
)

bibentry(
  bibtype  = "Manual",
  title    = paste0("palaeoverse: Prepare and Explore Data for Palaeobiological Analyses. R package version ", meta$Version),
  author   = authors,
  year     = format(Sys.time(), "%Y"),
  url      = "https://CRAN.R-project.org/package=palaeoverse",
  doi      = "10.5281/zenodo.7728638"
)
