Skip to contents

Copies the Quarto extensions in quartifyr_quarto_extensions (today A2-ai/quarto-plus) into <path>/_extensions/<owner>/<name>/ without touching the network. quarto::quarto_add_extension() and quarto add fetch from GitHub, which is not an option in a firewalled environment; this is the offline alternative.

Usage

install_quarto_extensions(
  path = ".",
  from = NULL,
  extensions = quartifyr_quarto_extensions,
  force = FALSE
)

Arguments

path

Target project directory. Defaults to the current directory.

from

Where to find the extensions: NULL for the bundled copies, a directory, or a .zip/.tar.gz/.tgz/.tar archive (for instance a GitHub "download ZIP" of the extension's repository). The extension is located by looking for a directory with the extension's name that holds an _extension.yml, wherever it sits in from, so both a repository checkout (_extensions/quarto-plus/) and a project's own _extensions/ (A2-ai/quarto-plus/) work.

extensions

Registry to install. Defaults to quartifyr_quarto_extensions; pass your own data frame in the same shape to install others from from.

force

Replace an extension that is already installed. Default FALSE, which leaves an existing _extensions/<owner>/<name>/ alone, so the function is safe to call again.

Value

The installed extension directories, named by extension id (invisibly).

Details

With from = NULL (the default) the copies bundled in this package are used (inst/extensions/quarto-plus/, an unmodified copy of the MIT-licensed upstream extension, with its LICENSE kept alongside; see inst/extensions/README.md for the commit it was taken from). Pass from to install a different version, for example one a site has vetted and mirrored internally.

See also

check_quarto_extensions() to verify what is installed, install_quartifyr_extension() for quartifyr's own extension.

Examples

project <- file.path(tempdir(), "my-report")
dir.create(project)
install_quarto_extensions(project)
list.files(file.path(project, "_extensions", "A2-ai", "quarto-plus"))
#> [1] "LICENSE"                     "_extension.yml"             
#> [3] "crossref.lua"                "header.lua"                 
#> [5] "style.lua"                   "table_of_contents.lua"      
#> [7] "terms_and_abbreviations.lua" "utils.lua"