citHeader("To cite mongolstats in publications use:")

# 'meta' is provided by R during CITATION evaluation and contains DESCRIPTION fields
title <- if (!is.null(meta$Title)) meta$Title else "mongolstats: Mongolian NSO Open Data and Boundaries (Tidy Client)"
version <- if (!is.null(meta$Version)) meta$Version else "0.0.0.9000"
year <- if (!is.null(meta$Date)) sub("-.*", "", meta$Date) else format(Sys.Date(), "%Y")
urls <- if (!is.null(meta$URL)) unlist(strsplit(meta$URL, ",", fixed = TRUE)) else character(0)

bibentry(
  bibtype = "Manual",
  title = title,
  author = person(given = "Temuulen", family = "Enebish"),
  year = year,
  note = paste("R package version", version),
  url = if (length(urls)) urls[1] else "https://github.com/temuulene/mongolstats"
)
