Package {quartodown}


Title: Package Websites Built Entirely with 'Quarto'
Version: 0.1.0
Description: Builds package websites with 'Quarto'. The whole site, help pages and vignettes included, is rendered by 'Quarto', so every 'Quarto' feature works, from callouts to code annotations. Functions mentioned in code link to their help pages, with hover tooltips.
License: MIT + file LICENSE
URL: https://bjarkehautop.github.io/quartodown/, https://github.com/bjarkehautop/quartodown
BugReports: https://github.com/bjarkehautop/quartodown/issues
SystemRequirements: Quarto command line tool (<https://github.com/quarto-dev/quarto-cli>).
Encoding: UTF-8
Imports: cli, desc, downlit, fansi, fs, quarto, tools, utils, xml2, yaml
Suggests: httr2, pkgload, servr, testthat (≥ 3.0.0), withr
VignetteBuilder: quarto
Config/Needs/website: tibble
Config/testthat/edition: 3
Config/roxygen2/version: 8.1.0
NeedsCompilation: no
Packaged: 2026-10-22 06:07:40 UTC; bjarke
Author: Bjarke Hautop Kristensen [aut, cre, cph], Hadley Wickham [ctb] (Code adapted from pkgdown), Jay Hesselberth [ctb] (Code adapted from pkgdown), Maëlle Salmon [ctb] (Code adapted from pkgdown), Olivier Roy [ctb] (Code adapted from pkgdown), Salim Brüggemann [ctb] (Code adapted from pkgdown), Posit Software, PBC [cph] (Copyright holder of pkgdown)
Maintainer: Bjarke Hautop Kristensen <bjarke.hautop@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-04 10:00:08 UTC

Build the package website

Description

Builds the package website into ⁠docs/⁠ with Quarto.

Usage

build_site(
  path = ".",
  tooltips = TRUE,
  freeze = FALSE,
  quiet = TRUE,
  devel = FALSE,
  preview = interactive()
)

Arguments

path

Path to the package root.

tooltips

Logical. Link references to the package's own functions (in code blocks and inline code) to their reference page, with a hover tooltip showing the function's usage and the first sentence of its description?

freeze

Logical. Reuse the results of code that ran in an earlier build, for pages whose source hasn't changed since? Uses Quarto's freeze, which keeps them in ⁠_quarto/_freeze/⁠.

quiet

Logical. Hide Quarto's rendering output?

devel

Logical. By default, the examples and vignettes run against the package installed from path into a temporary library. With devel = TRUE, they run against it loaded with pkgload::load_all() instead, which is faster, but code that starts other R processes (e.g. with callr or parallel workers) won't find the package there.

preview

Logical. Open the built site in a web browser with preview_site()? By default, only in interactive sessions.

Details

build_site() assembles a Quarto website project in ⁠_quarto/⁠ from the package sources and ⁠_quartodown/_quartodown.yml⁠, then renders it. It uses README.md (or, without one, DESCRIPTION), ⁠man/⁠, the vignettes (including those in subfolders), NEWS.md, LICENSE/LICENSE.md, and CODE_OF_CONDUCT.md, CONTRIBUTING.md and SUPPORT.md (at the top level or in ⁠.github/⁠). See vignette("quartodown") for what the site contains.

While it builds, the environment variable IN_QUARTODOWN is "true", so the package's examples and vignettes can check identical(Sys.getenv("IN_QUARTODOWN"), "true"). IN_QUARTODOWN_PKG is the name of the package whose site it is, which code shared between packages can check.

Value

Invisibly, the path to the built site.

Configuration

⁠_quartodown/_quartodown.yml⁠ is optional; use_quartodown() creates one. It can contain:

⁠_quartodown/extra.scss⁠ and ⁠_quartodown/extra.css⁠, if they exist, style every page, on top of quartodown's theme. The whole ⁠_quartodown/⁠ folder is copied into the Quarto project, so quarto settings can refer to other files in it by the same path.

See vignette("customizing", package = "quartodown") for the details.

Examples

## Not run: 
use_quartodown()
build_site()

## End(Not run)

Preview the built site

Description

Serves ⁠docs/⁠, as built by build_site(), in a web browser, and reloads the page when the site is rebuilt. The server keeps running for the rest of the R session and is reused by later calls, including build_site()'s (which, with a server already running, leaves the open page to reload instead of opening another).

Usage

preview_site(path = ".")

Arguments

path

Path to the package root.

Value

The server, invisibly; see servr::httw().

Examples

## Not run: 
build_site()
preview_site()

## End(Not run)

Set up a package to use quartodown

Description

Writes ⁠_quartodown/_quartodown.yml⁠, the configuration file build_site() reads. It starts with a ⁠reference:⁠ field listing every function currently documented in ⁠<path>/man/*.Rd⁠ in one "All functions" section. Also adds the .gitignore/.Rbuildignore entries the build needs (see Details) if they're not already there.

Usage

use_quartodown(path = ".")

Arguments

path

Path to the target package root. Defaults to the current directory.

Details

An existing ⁠_quartodown.yml⁠ is never overwritten.

use_quartodown() adds the following lines to .gitignore and .Rbuildignore (only the ones not already present in each file):

# .gitignore
_quarto/*
!_quarto/_freeze/

# .Rbuildignore
^docs$
^_quarto$
^_quartodown$

⁠_quarto/⁠ is the Quarto project build_site() generates and renders into ⁠docs/⁠. Its ⁠_freeze/⁠ directory holds the results of code run with build_site(freeze = TRUE), which can be committed so later builds, e.g. on CI, reuse them. ⁠_quartodown/⁠ holds the site's configuration and any files it uses, such as extra.scss.

Value

Invisibly, the path to ⁠_quartodown/_quartodown.yml⁠.

Examples

pkg <- tempfile("examplepkg")
dir.create(pkg)
write(
  "Package: examplepkg\nVersion: 0.0.0.9000",
  file.path(pkg, "DESCRIPTION")
)
use_quartodown(pkg)
readLines(file.path(pkg, "_quartodown", "_quartodown.yml"))
unlink(pkg, recursive = TRUE)

Set up a GitHub Actions workflow that publishes the site

Description

Writes .github/workflows/quartodown.yaml, a GitHub Actions workflow that builds the site and deploys it to the gh-pages branch. It runs build_site() on every push, pull request and release, but only deploys when it isn't a pull request. Also adds ⁠^\.github$⁠ to .Rbuildignore if it's not already there.

Usage

use_quartodown_action(path = ".", overwrite = FALSE)

Arguments

path

Path to the target package root. Defaults to the current directory.

overwrite

Logical. Replace an existing .github/workflows/quartodown.yaml? By default it's left as is.

Details

Once the workflow's first run has created the gh-pages branch, go to the Pages section of the repository's settings on GitHub and choose to deploy from that branch.

Value

Invisibly, the path to the workflow file.

Examples

pkg <- tempfile("examplepkg")
dir.create(pkg)
write(
  "Package: examplepkg\nVersion: 0.0.0.9000",
  file.path(pkg, "DESCRIPTION")
)
use_quartodown_action(pkg)
list.files(pkg, recursive = TRUE, all.files = TRUE)
unlink(pkg, recursive = TRUE)