build
Build Package Documentation
Description
Build Package Documentation
Usage
build(
path = find_source_package_root(getwd()),
out_dir = file.path(getwd(), "docs"),
extra_path = getwd(),
force = FALSE,
force_vignettes = force,
skip_init = FALSE,
clean = TRUE,
base_url = "http://localhost:1313",
hugo_theme = "github.com/google/docsy",
skip_hugo_mod_init = !startsWith(hugo_theme, "github.com"),
github_repo = NULL,
github_subdir = "docs",
github_branch = "main",
repo_root_path = find_repo_root(getwd()),
skip_metadata = TRUE,
vignette_output_options = NULL,
katex = FALSE,
init_config_options = NULL,
init_asset_dirs = NULL,
init_static_dirs = NULL
)
Arguments
path:character(1); path to source packageout_dir:character(1); output directory to write generated site content toextra_path: character(1); extra directory to scan for markdown files. The default is the current working directory. This is mostly useful for findingREADME.mdwhen your package root is not equal to your project root.force: ifTRUE, replace existing docs outputforce_vignettes: ifTRUE, replace docs vignette/article outputskip_init:logical(1); do not run init. See details.clean:logical(1); remove temporary filesbase_url:character(1); site base urlhugo_theme:character(1); hugo theme to use. Defaults to Google Docsyskip_hugo_mod_init:logical(1); whether to create ago.modfile.github_repo:character(1); github repo. IfNULL(default) this will be fetched automatically from the package description (URLorBugReportsfields)github_subdir:character(1); github subdirectory. This should match yourout_dirgithub_branch:character(1); main branch of your github repositoryrepo_root_path:character(1); repository root path. This is used to contruct repository links. If provided neitherpathandextra_pathmay be outside.skip_metadata:logical(1); do not generate a metadata-file. See build_metadata.vignette_output_options:list(): additionaloutput_optionsto render vignette output.katex:logical(1); ifTRUE, render math (dollar-sign) equations using KaTeXinit_config_options:list(); additional declarations included inconfig.yamlfile during init. See details.init_asset_dirs:list(); additional folders copied into theassetsdirectory during init. See details.init_static_dirs:list(); additional folders copied into thestaticdirectory during init. See details.
Details
The build result will be written as markdown files.
By default, build calls init as a first step unless skip_init is set to TRUE.
If init detects an existing folder at out_dir, it will not write anything (unless force = TRUE). This means it is safe to call build again after making changes to files which are written by init, such as the site config.