From 3ba39ee2d7f2fd0823b57ec4f9f2dba120484583 Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 9 Aug 2022 08:56:43 +0200 Subject: [PATCH] doc: re-built the doc --- DESCRIPTION | 2 +- NAMESPACE | 1 + man/amend_golem_config.Rd | 4 +- man/document_and_reload.Rd | 2 +- man/get_current_config.Rd | 16 ++++++++ man/golem_opts.Rd | 79 +++++++++++++++++++------------------- 6 files changed, 60 insertions(+), 44 deletions(-) create mode 100644 man/get_current_config.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 5117b403..65c5be9b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -89,4 +89,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.1 diff --git a/NAMESPACE b/NAMESPACE index 468dedd2..30bc57fd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -37,6 +37,7 @@ export(expect_shinytag) export(expect_shinytaglist) export(favicon) export(fill_desc) +export(get_current_config) export(get_golem_name) export(get_golem_options) export(get_golem_version) diff --git a/man/amend_golem_config.Rd b/man/amend_golem_config.Rd index 208f95a3..1c803ebb 100644 --- a/man/amend_golem_config.Rd +++ b/man/amend_golem_config.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/config.R +% Please edit documentation in R/golem-yaml-utils.R \name{amend_golem_config} \alias{amend_golem_config} \title{Amend golem config file} @@ -8,7 +8,7 @@ amend_golem_config( key, value, config = "default", - pkg = get_golem_wd(), + pkg = golem::pkg_path(), talkative = TRUE ) } diff --git a/man/document_and_reload.Rd b/man/document_and_reload.Rd index 8d0c84ec..95b60561 100644 --- a/man/document_and_reload.Rd +++ b/man/document_and_reload.Rd @@ -24,7 +24,7 @@ which defaults to \code{c("collate", "namespace", "rd")}.} \item{load_code}{A function used to load all the R code in the package directory. The default, \code{NULL}, uses the strategy defined by -the \code{load} roxygen option, which defaults to \code{\link[roxygen2:load]{load_pkgload()}}. +the \code{load} roxygen option, which defaults to \code{\link[roxygen2:load_pkgload]{load_pkgload()}}. See \link[roxygen2]{load} for more details.} \item{clean}{If \code{TRUE}, roxygen will delete all files previously diff --git a/man/get_current_config.Rd b/man/get_current_config.Rd new file mode 100644 index 00000000..e2ed0da8 --- /dev/null +++ b/man/get_current_config.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/config.R +\name{get_current_config} +\alias{get_current_config} +\title{Get the path to the current config File} +\usage{ +get_current_config(path = ".") +} +\arguments{ +\item{path}{Path to start looking for the config} +} +\description{ +This function tries to guess where the golem-config file is located. +If it can't find it, this function asks the +user if they want to set the golem skeleton. +} diff --git a/man/golem_opts.Rd b/man/golem_opts.Rd index fa7de33a..4601e99d 100644 --- a/man/golem_opts.Rd +++ b/man/golem_opts.Rd @@ -1,75 +1,74 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/options.R -\name{set_golem_options} -\alias{set_golem_options} -\alias{set_golem_wd} -\alias{set_golem_name} -\alias{set_golem_version} +% Please edit documentation in R/golem-yaml-get.R, R/golem-yaml-set.R, +% R/set_golem_options.R +\name{get_golem_wd} \alias{get_golem_wd} \alias{get_golem_name} \alias{get_golem_version} +\alias{set_golem_name} +\alias{set_golem_version} +\alias{set_golem_options} \title{\code{{golem}} options} \usage{ -set_golem_options( - golem_name = golem::pkg_name(), - golem_version = golem::pkg_version(), - golem_wd = golem::pkg_path(), - app_prod = FALSE, - talkative = TRUE +get_golem_wd(use_parent = TRUE, path = golem::pkg_path()) + +get_golem_name( + config = Sys.getenv("GOLEM_CONFIG_ACTIVE", Sys.getenv("R_CONFIG_ACTIVE", "default")), + use_parent = TRUE, + path = golem::pkg_path() ) -set_golem_wd(path = golem::pkg_path(), talkative = TRUE) +get_golem_version( + config = Sys.getenv("GOLEM_CONFIG_ACTIVE", Sys.getenv("R_CONFIG_ACTIVE", "default")), + use_parent = TRUE, + path = golem::pkg_path() +) set_golem_name( name = golem::pkg_name(), - path = golem::pkg_path(), + pkg = golem::pkg_path(), talkative = TRUE ) set_golem_version( version = golem::pkg_version(), - path = golem::pkg_path(), + pkg = golem::pkg_path(), talkative = TRUE ) -get_golem_wd(use_parent = TRUE, path = golem::pkg_path()) - -get_golem_name( - config = Sys.getenv("R_CONFIG_ACTIVE", "default"), - use_parent = TRUE, - path = golem::pkg_path() -) - -get_golem_version( - config = Sys.getenv("R_CONFIG_ACTIVE", "default"), - use_parent = TRUE, - path = golem::pkg_path() +set_golem_options( + golem_name = golem::pkg_name(), + golem_version = golem::pkg_version(), + golem_wd = golem::pkg_path(), + app_prod = FALSE, + talkative = TRUE, + config_file = golem::get_current_config(golem_wd) ) } \arguments{ -\item{golem_name}{Name of the current golem.} +\item{use_parent}{\code{TRUE} to scan parent directories for +configuration files if the specified config file isn't found.} -\item{golem_version}{Version of the current golem.} +\item{path}{The path to set the golem working directory. +Note that it will be passed to \code{normalizePath}.} -\item{golem_wd}{Working directory of the current golem package.} +\item{config}{Name of configuration to read from. Defaults to +the value of the \code{R_CONFIG_ACTIVE} environment variable +("default" if the variable does not exist).} -\item{app_prod}{Is the \code{{golem}} in prod mode?} +\item{name}{The name of the app} \item{talkative}{Should the messages be printed to the console?} -\item{path}{The path to set the golem working directory. -Note that it will be passed to \code{normalizePath}.} +\item{version}{The version of the app} -\item{name}{The name of the app} +\item{golem_name}{Name of the current golem.} -\item{version}{The version of the app} +\item{golem_version}{Version of the current golem.} -\item{use_parent}{\code{TRUE} to scan parent directories for -configuration files if the specified config file isn't found.} +\item{golem_wd}{Working directory of the current golem package.} -\item{config}{Name of configuration to read from. Defaults to -the value of the \code{R_CONFIG_ACTIVE} environment variable -("default" if the variable does not exist).} +\item{app_prod}{Is the \code{{golem}} in prod mode?} } \value{ Used for side-effects for the setters, and values from the