# Year resolution: CRAN sets Date/Publication on the installed package; fall
# back to DESCRIPTION's Date, then to the current year, so the package entry
# never renders as "(????)".
year <- if (!is.null(meta$`Date/Publication`)) {
  substr(meta$`Date/Publication`, 1, 4)
} else if (!is.null(meta$Date)) {
  substr(meta$Date, 1, 4)
} else {
  format(Sys.Date(), "%Y")
}
note <- sprintf("R package version %s", meta$Version)

bibentry(
  bibtype = "Article",
  title   = "Diffusion/Contagion Processes on Social Networks",
  author  = c(
    person("Thomas", "Valente", comment = c(ORCID = "0000-0002-8824-5816")),
    person("George", "Vega Yon", comment = c(ORCID = "0000-0002-3171-0844"))
  ),
  journal = "Health Education & Behavior",
  year    = "2020",
  month   = "feb",
  volume  = "47",
  number  = "2",
  pages   = "235-248",
  issn    = "1090-1981",
  doi     = "10.1177/1090198120901497",
  url     = "https://doi.org/10.1177/1090198120901497",
  note    = "PMID: 32090655",
  textVersion = paste(
    "Valente TW, Vega Yon GG (2020). Diffusion/Contagion Processes on Social",
    "Networks. Health Education & Behavior 47(2), 235-248.",
    "https://doi.org/10.1177/1090198120901497"
  ),
  header = "To cite netdiffuseR in publications use the following paper:"
)

bibentry(
  bibtype = "Manual",
  title   = "{{netdiffuseR: Analysis of Diffusion and Contagion Processes on Networks}}",
  author  = c(
    person("George", "Vega Yon", comment = c(ORCID = "0000-0002-3171-0844")),
    person("Anibal", "Olivera Morales", comment = c(ORCID = "0009-0000-3736-7939")),
    person("Thomas", "Valente", comment = c(ORCID = "0000-0002-8824-5816"))
  ),
  year    = year,
  note    = note,
  url     = "https://github.com/USCCANA/netdiffuseR",
  doi     = "10.32614/CRAN.package.netdiffuseR",
  header  = "And the R package itself:"
)
