| 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 |
quiet |
Logical. Hide Quarto's rendering output? |
devel |
Logical. By default, the examples and vignettes run against
the package installed from |
preview |
Logical. Open the built site in a web browser with
|
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:
-
url: the site's address, if it isn't the firstURLinDESCRIPTIONthat isn't a source repository. -
reference: the sections of the function reference index and the topics each lists, by name or with selectors such asstarts_with(). The format is the same as pkgdown's. -
navbar: the items on the navbar'sleftandright: keywords such asreferenceandarticles, vignettes, and Quarto navbar items and menus. Withstyle: sidebar, theleftitems go in a sidebar instead, with a link to every reference page. -
home:file, the.mdor.qmdfile the home page shows instead ofREADME.md;sidebar, the sidebar'sstructure(its sections, in order) andcomponents(sections of your own), orfalseto show the page as written, without it; andlinks, added to the sidebar's links. -
authors: by a person's name, anhrefto link it andhtmlto replace it; and undersidebarandfooter, therolesshown, withbefore/aftertext in the sidebar andtextin the footer. -
repo: the repository'surls (home, and the prefixes of links to a file,source; an issue,issue; and a user,user) andbranch, if not from DESCRIPTION's GitHub, GitLab or CodebergURL. -
theme: thelightanddarkthemes: names of Quarto's built-in themes, such asflatlyanddarkly, or.scssfiles in_quartodown/. By default,defaultanddarkly. -
redirects: pairs of paths, from an old page to the one replacing it, such as["reference/old.html", "reference/new.html"]. -
quarto: settings merged over the generated Quarto configuration.
_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
|
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)