Skip to content

Commit

Permalink
docs: add DOI to CITATION (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored May 15, 2023
2 parents 599e6ed + 7ac399a commit 12e54c9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,38 @@ bibentry(bibtype="Article",
year=2006,
url="https://igraph.org")

note <- sprintf("R package version %s", meta$Version)
# https://github.com/cran/lidR/blob/f0dae39007c9d174f6e1962ff236fd8826f1501d/inst/CITATION#L21
year <- format(Sys.Date(), "%Y")
authors <- meta$`Authors@R`
authors <- utils:::.read_authors_at_R_field(authors)
authors <- Filter(function(e) {
!(is.null(e$given) && is.null(e$family)) && !is.na(match("aut", e$role))
}, authors)
authors <- format(authors, include = c("given", "family"))

# Step 1: Get text citation and replace there the abb.
entry_for_txt <- format(bibentry(
bibtype = "Manual",
title = "{igraph}: Network Analysis and Visualization in R",
author = authors,
year = year,
note = note,
doi = "10.5281/zenodo.7682609",
url = "https://CRAN.R-project.org/package=igraph"
), style = "text")

txt <- gsub("Horvát S", "Horvát Sz", entry_for_txt)

aut_new <- sub("Szabolcs", "{\\\\relax Sz}abolcs", authors)

bibentry(
bibtype = "Manual",
title = "{igraph}: Network Analysis and Visualization in R",
author = aut_new,
year = year,
note = note,
doi = "10.5281/zenodo.7682609",
url = "https://CRAN.R-project.org/package=igraph",
textVersion = txt
)

0 comments on commit 12e54c9

Please sign in to comment.