Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CRAN's DOI in autogenerated CITATION #2681

Closed
jmaspons opened this issue Jun 30, 2024 · 6 comments
Closed

Add CRAN's DOI in autogenerated CITATION #2681

jmaspons opened this issue Jun 30, 2024 · 6 comments
Labels
feature a feature request or enhancement home 🏠 tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@jmaspons
Copy link
Contributor

Recently, all packages published at CRAN get a DOI. Would be nice to add it at authors.html#citation.

@hadley hadley added feature a feature request or enhancement home 🏠 labels Jul 3, 2024
@hadley
Copy link
Member

hadley commented Jul 3, 2024

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.

@hadley hadley added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jul 3, 2024
@jmaspons
Copy link
Contributor Author

jmaspons commented Jul 4, 2024

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.

@hadley
Copy link
Member

hadley commented Jul 5, 2024

Oh well that's very easy then 😄

@jmaspons
Copy link
Contributor Author

Already in R utils::citation() r-devel/r-svn@6629248

@luisDVA
Copy link

luisDVA commented Aug 15, 2024

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)

@hadley
Copy link
Member

hadley commented Aug 15, 2024

Thanks for the exploration!

@hadley hadley closed this as completed Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement home 🏠 tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

No branches or pull requests

3 participants