Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 119 additions & 1 deletion R/create_pub_listing.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,119 @@
# taken from
# https://github.com/mcanouil/mickael.canouil.fr/blob/main/publications.r # nolint: line_length_linter

normalize_bibtex_months <- function(entries) {
# Crossref can emit full month names (and "Sept"); Pandoc only retains
# the month when BibTeX uses a standard three-letter month macro.
month_names <- c(month.name, "Sept")
month_macros <- c(tolower(month.abb), "sep")

unname(vapply(
entries,
FUN = function(entry) {
characters <- strsplit(entry, "", fixed = TRUE)[[1]]
depth <- 0L
field_start <- FALSE
in_quotes <- FALSE
escaped <- FALSE
index <- 1L

while (index <= length(characters)) {
character <- characters[[index]]
if (in_quotes) {
if (character == '"' && !escaped) {
in_quotes <- FALSE
}
escaped <- character == "\\" && !escaped
index <- index + 1L
next
}
if (character == "{") {
depth <- depth + 1L
} else if (character == "}") {
depth <- depth - 1L
} else if (character == '"') {
in_quotes <- TRUE
} else if (depth == 1L && character == ",") {
field_start <- TRUE
} else if (depth == 1L && field_start && !grepl("\\s", character)) {
field_start <- FALSE
field_end <- index + 4L
if (field_end <= length(characters)) {
field_name <- tolower(
paste0(characters[index:field_end], collapse = "")
)
}
if (field_end <= length(characters) && field_name == "month") {
value_start <- field_end + 1L
while (value_start <= length(characters) &&
grepl("\\s", characters[[value_start]])) { # nolint: indentation_linter, line_length_linter.
value_start <- value_start + 1L
}
if (value_start <= length(characters) &&
characters[[value_start]] == "=") { # nolint: indentation_linter, line_length_linter.
value_start <- value_start + 1L
while (value_start <= length(characters) &&
grepl("\\s", characters[[value_start]])) { # nolint: indentation_linter, line_length_linter.
value_start <- value_start + 1L
}
value_end <- value_start
if (characters[[value_start]] == "{") {
value_depth <- 1L
value_end <- value_end + 1L
while (value_end <= length(characters) && value_depth > 0L) {
value_depth <- value_depth +
(characters[[value_end]] == "{") -
(characters[[value_end]] == "}")
value_end <- value_end + 1L
}
value_end <- value_end - 1L
value <- paste0(
characters[(value_start + 1L):(value_end - 1L)],
collapse = ""
)
} else if (characters[[value_start]] == '"') {
value_end <- value_end + 1L
while (value_end <= length(characters) &&
characters[[value_end]] != '"') { # nolint: indentation_linter, line_length_linter.
value_end <- value_end + 1L
}
value <- paste0(
characters[(value_start + 1L):(value_end - 1L)],
collapse = ""
)
} else {
while (value_end <= length(characters) &&
!characters[[value_end]] %in% c(",", "}")) { # nolint: indentation_linter, line_length_linter.
value_end <- value_end + 1L
}
value_end <- value_end - 1L
value <- paste0(
characters[value_start:value_end],
collapse = ""
)
}
month_index <- match(tolower(trimws(value)), tolower(month_names))
if (!is.na(month_index)) {
return(paste0(
paste0(characters[seq_len(value_start - 1L)], collapse = ""),
month_macros[[month_index]],
paste0(
characters[seq.int(value_end + 1L, length(characters))],
collapse = ""
)
))
}
}
}
}
index <- index + 1L
}
entry
},
FUN.VALUE = character(1)
))
}

create_pub_listing <- function(bib = bibtex::read.bib(bib_file),
bib_file = "publications.bib",
author = "Canouil",
Expand All @@ -24,7 +137,12 @@ create_pub_listing <- function(bib = bibtex::read.bib(bib_file),
),
-3
)

# Quote dates so YAML doesn't interpret year-only values as numbers
article <- article |>
stringr::str_replace(
"^(\\s*issued:\\s*)(\\d{4}(?:-\\d{2}(?:-\\d{2})?)?)\\s*$",
'\\1"\\2"'
)
article <- c(
article,
grep(" container-title:", article, value = TRUE) |>
Expand Down
3 changes: 2 additions & 1 deletion data-raw/papers.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ categories <- ifelse(is_preprint, "preprint", "")
bibtex_entries <-
cr_cn(dois, format = "bibtex") |>
unlist() |>
stringr::str_trim(side = "left")
stringr::str_trim(side = "left") |>
normalize_bibtex_months()

bibtex_entries |>
cat(file = "publications.bib")
Expand Down
46 changes: 26 additions & 20 deletions papers/DOIs.csv
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
nickname,DOI

hlye lps iga diagnostics preprint, https://doi.org/10.1101/2025.06.20.25329792
melioidosis preprint, http://dx.doi.org/10.2139/ssrn.5312903
TCV decision-making preprint, https://doi.org/10.12688/verixiv.3487.2
shigella preprint, https://doi.org/10.64898/2026.08.03.26359548
serocalculator preprint, https://doi.org/10.1101/2025.06.04.25328941
niger EF preprint, https://doi.org/10.64898/2026.08.03.26359544
dengue Nepal preprint, https://doi.org/10.64898/2026.07.14.26357903
cambodia EF preprint, https://doi.org/10.64898/2026.02.01.26343908

Bangladesh rapid, https://doi.org/10.1093/ofid/ofag197
Kenya seroepi, 10.3201/eid3203.250469
covid typhoid, https://doi.org/10.1371/journal.pntd.0013242
trachoma serology, https://doi.org/10.1038/s41467-025-60581-z
vellore wastewater sero, https://doi.org/10.1371/journal.pntd.0012373
reinfections, https://doi.org/10.1016/j.epidem.2025.100874
lancet GH SEAP,https://doi.org/10.1016/S2214-109X(22)00119-X
Morrison SIM HIV,https://doi.org/10.1002/sim.8196
HEV Nepal,https://doi.org/10.1371/journal.pntd.0012375
scrub dynamics,10.4269/ajtmh.23-0475
scrub pediatric kinetics,10.1093/jtm/taad143
ABC pertussis,10.1002/sim.9906
OFID seroepi for enteric fever,10.1093/ofid/ofad021
EF seroincidence Juba,10.3201/eid2811.220239
Lancent microbe typhoid,10.1016/S2666-5247(22)00114-8
Ethiopia enterics,10.1371/journal.pntd.0008647
Morrison biometrics HIV, https://doi.org/10.1111/biom.13472
Morrison SCID HIV, https://doi.org/10.1515/scid-2017-0003
2026 Saiprom melioidosis kinetics, https://doi.org/10.1016/j.lanmic.2026.101450
2026 Seidman EF diagnostics, https://doi.org/10.3201/eid3208.250753
2026 Munira EF Bangladesh rapid, https://doi.org/10.1093/ofid/ofag197
2026 Khan EF Kenya seroepi, https://doi.org/10.3201/eid3203.250469
2026 Tamrakar EF covid Nepal, https://doi.org/10.1371/journal.pntd.0013242
2026 Teunis EF reinfections, https://doi.org/10.1016/j.epidem.2025.100874
2025 Kamau trachoma serology, https://doi.org/10.1038/s41467-025-60581-z
2025 Abraham vellore wastewater sero, https://doi.org/10.1371/journal.pntd.0012373
2024 Katuwal HEV Nepal,https://doi.org/10.1371/journal.pntd.0012375
2024 Aiemjoy scrub seroincidence,https://doi.org/10.4269/ajtmh.23-0475
2023 Looareesuwan Aiemjoy pediatric scrub, https://doi.org/10.1093/jtm/taad143
2023 Teunis ABC pertussis,https://doi.org/10.1002/sim.9906
2023 Aiemjoy EF seroepi OFID, https://doi.org/10.1093/ofid/ofad021
2023 Tedijanto trachoma serology, https://doi.org/10.1038/s41467-023-38940-5
2022 Aiemjoy EF seroincidence Juba, https://doi.org/10.3201/eid2811.220239
2022 Garrett EF SEAP,https://doi.org/10.1016/S2214-109X(22)00119-X
2022 Aiemjoy EF seroincidence,https://doi.org/10.1016/S2666-5247(22)00114-8
2021 Morrison biometrics HIV, https://doi.org/10.1111/biom.13472
2020 Aiemjoy Ethiopia enterics,https://doi.org/10.1371/journal.pntd.0008647
2019 Morrison SIM HIV,https://doi.org/10.1002/sim.8196
2018 Morrison SCID HIV, https://doi.org/10.1515/scid-2017-0003
1 change: 1 addition & 0 deletions people/kaiemjoy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.httr-oauth
Loading
Loading