R/enable_roxygenize.R

Defines functions enable_roxygenize

#' Enable documentation generation using roxygen2
#'
#' @param path to to Rproj file
#' @noRd
#'
enable_roxygenize <- function(path = list.files(
    path = ".",
    pattern = "Rproj$",
    full.names = TRUE
  )[1]) {
  cli_cat_bullet(
    sprintf("Reading %s content ", basename(path)),
    bullet = "info",
    bullet_col = "green"
  )
  source <- yaml::read_yaml(file = path)
  cli_cat_bullet(
    "Enable roxygen2",
    bullet = "info",
    bullet_col = "green"
  )
  source[["PackageRoxygenize"]] <- "rd,collate,namespace"
  yaml::write_yaml(x = source, file = path)

  cat_green_tick("Done")
}

Try the golem package in your browser

Any scripts or data that you put into this service are public.

golem documentation built on June 7, 2023, 5:46 p.m.