Add CRAN's DOI in autogenerated CITATION
Recently, all packages published at CRAN get a DOI. Would be nice to add it at authors.html#citation.
The first problem to solve here is figuring out how to the get published DOI of a package. Then it looks like a fairly simple change to citation_auto(); we'd just override the existing DOI if it's null.
I think that the DOI is deterministic
doi <- paste0("10.32614/CRAN.package.", pkg_name)
url <- paste0("https://doi.org/", doi)
Then it's just a matter of determining whether the package is published at CRAN or not, which it seems pkgdown already have functions for View on CRAN link.
Oh well that's very easy then 😄
Already in R utils::citation() https://github.com/r-devel/r-svn/commit/66292483683487a651e33e5fb9b63bc405e15015
citation is a complicated function, probably worth waiting until utils::citation() deals with DOIs in the next release of R.
@hadley approves of this strategy (dev day pers. comm)
Thanks for the exploration!