year <- format(Sys.time(), "%Y")
abs <- trimws(gsub("\\s+", " ", meta$Description))
abs <- gsub("'", "", abs, fixed = TRUE)
title <- gsub("'", "", meta$Title, fixed = TRUE)
title <- gsub("Visual Studio Code", "{Visual Studio Code}", title, fixed = TRUE)
title <- gsub("RStudio", "{RStudio}", title, fixed = TRUE)
title <- gsub("TextMate", "{TextMate}", title, fixed = TRUE)
title <- gsub("Positron", "{Positron}", title, fixed = TRUE)

pkg <- meta$Package
doi <- "10.32614/CRAN.package.rstudiothemes"

bibentry(
  "Manual",
  header = paste0("To cite '", pkg, "' in publications use:"),
  title = paste0("{", pkg, "}: ", gsub("'", "", title)),
  doi = doi,
  author = c(person("Diego", "Hernangómez")),
  year = year,
  version = meta$Version,
  url = unlist(strsplit(meta$URL, ","))[1],
  abstract = abs,
  key = paste0("R-", pkg)
)
