setup_docs {altdoc}R Documentation

Initialize documentation website settings

Description

Creates a subdirectory called ⁠altdoc/⁠ in the package root directory to store the settings files used to by one of the documentation generator utilities (docsify, docute, mkdocs, or quarto_website). The files in this folder are never altered automatically by altdoc unless the user explicitly calls overwrite=TRUE. They can thus be edited manually to customize the sidebar and website.

Usage

setup_docs(tool, path = ".", overwrite = FALSE)

Arguments

tool

String. "docsify", "docute", "mkdocs", or "quarto_website".

path

Path to the package root directory.

overwrite

Logical. If TRUE, overwrite existing files. Warning: This will completely delete the settings files in the altdoc directory, including any customizations you may have made.

Package structure

altdoc makes assumptions about your package structure:

Altdoc variables

The settings files in the ⁠altdoc/⁠ directory can include ⁠$ALTDOC⁠ variables which are replaced automatically by altdoc when calling render_docs():

Also note that you can store images and static files in the ⁠altdoc/⁠ directory. All the files in this folder are copied to ⁠docs/⁠ and made available in the root of the website, so you can link to them easily.

Altdoc preambles

When you call render_docs(), altdoc will automatically paste the content of one of these three files to the top of a document:

The README file uses the vignette preamble.

To preempt this behavior, add your own preamble to the README file or to a vignette.

Examples

if (interactive()) {

  # Create docute documentation
  setup_docs(tool = "docute")

  # Create docsify documentation
  setup_docs(tool = "docsify")

  # Create mkdocs documentation
  setup_docs(tool = "mkdocs")

  # Create quarto website documentation
  setup_docs(tool = "quarto_website")
}

[Package altdoc version 0.3.0 Index]