year <- format(Sys.time(), "%Y")
abs <- trimws(gsub("\\s+", " ", meta$Description))
abs <- gsub("'", "", abs)
title <- trimws(gsub("'", "", meta$Title, fixed = TRUE))
pkg <- trimws(meta$Package)
title <- gsub("GeoBoundaries", "geoBoundaries", title)
doi <- "10.5281/zenodo.17554275"

bibentry(
  "Manual",
  header = paste0("To cite '", pkg, "' in publications use:"),
  title = paste0("{", pkg, "}: ", gsub("'", "", title)),
  author = c(person("Diego", "Hernangómez")),
  year = year,
  version = meta$Version,
  url = unlist(strsplit(meta$URL, ","))[1],
  abstract = abs,
  doi = doi,
  key = paste0("R-", pkg)
)

bibentry(
  header = "Please cite also:",
  bibtype = "Article",
  key = "10.1371/journal.pone.0231866",
  title = "{geoBoundaries}: A global database of political administrative boundaries",
  author = c(
    person(given = "Daniel", family = "Runfola"),
    person(given = "Austin", family = "Anderson"),
    person(given = "Heather", family = "Baier"),
    person(given = "Matt", family = "Crittenden"),
    person(given = "Elizabeth", family = "Dowker"),
    person(given = "Sydney", family = "Fuhrig"),
    person(given = "Seth", family = "Goodman"),
    person(given = "Grace", family = "Grimsley"),
    person(given = "Rachel", family = "Layko"),
    person(given = "Graham", family = "Melville"),
    person(given = "Maddy", family = "Mulder"),
    person(given = "Rachel", family = "Oberman"),
    person(given = "Joshua", family = "Panganiban"),
    person(given = "Andrew", family = "Peck"),
    person(given = "Leigh", family = "Seitz"),
    person(given = "Sylvia", family = "Shea"),
    person(given = "Hannah", family = "Slevin"),
    person(given = "Rebecca", family = "Youngerman"),
    person(given = "Lauren", family = "Hobbs")
  ),
  year = "2020",
  month = "04",
  journal = "PLOS ONE",
  publisher = "Public Library of Science",
  volume = "15",
  number = "4",
  pages = "1--9",
  doi = "10.1371/journal.pone.0231866",
  url = "https://doi.org/10.1371/journal.pone.0231866"
)
