Add a Sphinx documentation site to an R package

use_sphinx(path = ".", docs_dir = "docs", overwrite = FALSE, github_actions = TRUE, source_branch = NULL)

Scaffold a conventional Sphinx source directory configured for the Furo theme and the R domain bundled with rd2sphinx.

Arguments:
  • path – Path to an R package source directory.

  • docs_dir – Sphinx source directory, relative to path by default.

  • overwrite – Replace existing scaffold files.

  • github_actions – Create a standalone GitHub Pages workflow.

  • source_branch – Source branch shown by Furo’s source links. When NULL, detect the branch while Sphinx builds and fall back to "main".

Returns:

Invisibly, the paths that were created or updated.