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 package
  • out_dir: character(1); output directory to write generated site content to
  • extra_path: character(1); extra directory to scan for markdown files. The default is the current working directory. This is mostly useful for finding README.md when your package root is not equal to your project root.
  • force: if TRUE, replace existing docs output
  • force_vignettes: if TRUE, replace docs vignette/article output
  • skip_init: logical(1); do not run init. See details.
  • clean: logical(1); remove temporary files
  • base_url: character(1); site base url
  • hugo_theme: character(1); hugo theme to use. Defaults to Google Docsy
  • skip_hugo_mod_init: logical(1); whether to create a go.mod file.
  • github_repo: character(1); github repo. If NULL (default) this will be fetched automatically from the package description (URL or BugReports fields)
  • github_subdir: character(1); github subdirectory. This should match your out_dir
  • github_branch: character(1); main branch of your github repository
  • repo_root_path: character(1); repository root path. This is used to contruct repository links. If provided neither path and extra_path may be outside.
  • skip_metadata: logical(1); do not generate a metadata-file. See build_metadata.
  • vignette_output_options: list(): additional output_options to render vignette output.
  • katex: logical(1); if TRUE, render math (dollar-sign) equations using KaTeX
  • init_config_options: list(); additional declarations included in config.yaml file during init. See details.
  • init_asset_dirs: list(); additional folders copied into the assets directory during init. See details.
  • init_static_dirs: list(); additional folders copied into the static directory 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.