key <- paste0("R-", meta$Package)
year <- sub("-.*", "", meta$Date)
note <- sprintf("R package version %s", meta$Version)
doi <- meta$DOI
title <- paste0(meta$Package, ": ", meta$Title)

desc <- utils::packageDescription(meta$Package)

is_github <- !is.null(desc$GithubRepo)

if (is_github) {
  url <- with(desc, paste0("https://github.com/",
                           GithubUsername, "/",
                           GithubRepo, "/",
                           "tree/",
                           desc$GithubSHA1))
} else {
  url <- paste0("https://doi.org/", doi)
}


bibentry(bibtype = "Manual",
         key = key,
         title = title,
         author = person(given = "Elio",
                         family = "Campitelli"),
         year = year,
         note = note,
         url  = url,
         doi  = doi)
