Package {pkgsite}


Title: Convert the Reference Pages into 'Quarto' Files
Version: 0.1.0
Description: Makes it easier to create a 'Quarto' website for an 'R' package. Converts 'R' documentation ('Rd') files into 'Quarto' Markdown documents individually. Supports configuration via the '_quarto.yml' file and groups functions using 'roxygen2' family tags.
License: MIT + file LICENSE
URL: https://github.com/edgararuiz/pkgsite
BugReports: https://github.com/edgararuiz/pkgsite/issues
Depends: R (≥ 4.1)
Imports: cli, fs, purrr, rlang, tools, yaml
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Config/roxygen2/version: 8.0.0
NeedsCompilation: no
Packaged: 2026-06-09 14:06:49 UTC; edgar
Author: Edgar Ruiz [aut, cre], Posit Software, PBC ROR ID [cph, fnd]
Maintainer: Edgar Ruiz <edgar@posit.co>
Repository: CRAN
Date/Publication: 2026-06-17 13:20:08 UTC

Create a Quarto file that lists the available reference pages

Description

Create a Quarto file that lists the available reference pages

Usage

index_to_qmd(pkg = ".", template = NULL, quarto_file_path = NULL)

Arguments

pkg

Path to the root of the R package. Defaults to ".".

template

The path to a Quarto file that can be used as the template for all of the resulting reference files. If left NULL, pkgsite will use its default template.

quarto_file_path

Path to the folder containing ⁠_quarto.yml⁠. Use when the Quarto project root differs from the package root (e.g. the package lives in a sub-folder of a larger Quarto project). Must be a directory path. Defaults to NULL, in which case pkg is used.

Value

A character vector with the contents of a document that links to the converted Quarto documents.

See Also

Other Conversion functions: rd_to_list(), rd_to_qmd()

Examples

library(pkgsite)
example_pkg <- system.file("example", package = "pkgsite")
index_to_qmd(pkg = example_pkg)

Converts a given 'Rd' file into a list object

Description

This function is meant to be used as an intermediate object that could be used as an easy way to convert the information inside the 'Rd' into other formats or outputs.

Usage

rd_to_list(path)

Arguments

path

The path to the source Rd file

Value

A list object that contains the contents of the Rd file

See Also

Other Conversion functions: index_to_qmd(), rd_to_qmd()

Examples

library(pkgsite)
example_pkg <- system.file("example", package = "pkgsite")
rd_to_list(file.path(example_pkg, "man", "rd_to_list.Rd"))

Converts 'Rd' to Quarto files

Description

Converts 'Rd' to Quarto files

Usage

rd_to_qmd(
  path,
  pkg = ".",
  examples = TRUE,
  not_run_examples = FALSE,
  template = NULL,
  quarto_file_path = NULL
)

Arguments

path

The path to the source Rd file

pkg

Path to the root of the R package. Defaults to ".".

examples

Flag that sets the examples code chunk to be evaluated when the Quarto document is rendered

not_run_examples

Flag that sets the "do not run" examples code chunk to be evaluated when the Quarto document is rendered

template

The path to a Quarto file that can be used as the template for all of the resulting reference files. If left NULL, pkgsite will use its default template.

quarto_file_path

Path to the folder containing ⁠_quarto.yml⁠. Use when the Quarto project root differs from the package root (e.g. the package lives in a sub-folder of a larger Quarto project). Must be a directory path. Defaults to NULL, in which case pkg is used.

Value

A character vector with the resulting contents of converting the Rd file format into a Quarto file format.

See Also

Other Conversion functions: index_to_qmd(), rd_to_list()

Examples

library(pkgsite)
example_pkg <- system.file("example", package = "pkgsite")
rd_to_qmd(file.path(example_pkg, "man", "rd_to_qmd.Rd"), pkg = example_pkg)

Writes the reference pages and index as Quarto files

Description

Writes the reference pages and index as Quarto files

Usage

write_reference(
  pkg = ".",
  target_folder = NULL,
  examples = TRUE,
  not_run_examples = NULL,
  template = NULL,
  index_file = NULL,
  index_template = NULL,
  quarto_file_path = NULL
)

Arguments

pkg

Path to the root of the R package. Defaults to ".".

target_folder

Path to the folder where the Quarto files will be written. Defaults to NULL, which resolves to "reference/" (or the dir value under pkgsite > reference in ⁠_quarto.yml⁠ if set).

examples

Flag that sets the examples code chunk to be evaluated when the Quarto document is rendered

not_run_examples

Flag that sets the "do not run" examples code chunk to be evaluated when the Quarto document is rendered

template

The path to a Quarto file that can be used as the template for all of the resulting reference files. If left NULL, pkgsite will use its default template.

index_file

The name assigned to the resulting index Quarto file

index_template

The path to a Quarto file that can be used as the template for the index Quarto file

quarto_file_path

Path to the folder containing ⁠_quarto.yml⁠. Use when the Quarto project root differs from the package root (e.g. the package lives in a sub-folder of a larger Quarto project). Must be a directory path. Defaults to NULL, in which case pkg is used.

Value

A set of Quarto files written to the specified path based on the number of Rd files in the package, plus an additional one that is the index.

See Also

Other Quarto file creation: write_reference_index(), write_reference_pages()

Examples


library(pkgsite)
example_pkg <- system.file("example", package = "pkgsite")
write_reference(pkg = example_pkg, target_folder = tempdir())


Writes the index of the reference pages into a Quarto file

Description

Writes the index of the reference pages into a Quarto file

Usage

write_reference_index(
  pkg = ".",
  target_folder = NULL,
  index_file = "index.qmd",
  index_template = NULL,
  quarto_file_path = NULL
)

Arguments

pkg

Path to the root of the R package. Defaults to ".".

target_folder

Path to the folder where the Quarto files will be written. Defaults to NULL, which resolves to "reference/" (or the dir value under pkgsite > reference in ⁠_quarto.yml⁠ if set).

index_file

The name assigned to the resulting index Quarto file

index_template

The path to a Quarto file that can be used as the template for the index Quarto file

quarto_file_path

Path to the folder containing ⁠_quarto.yml⁠. Use when the Quarto project root differs from the package root (e.g. the package lives in a sub-folder of a larger Quarto project). Must be a directory path. Defaults to NULL, in which case pkg is used.

Value

A Quarto file that links to the individual Quarto documentation files

See Also

Other Quarto file creation: write_reference(), write_reference_pages()

Examples


library(pkgsite)
example_pkg <- system.file("example", package = "pkgsite")
write_reference_index(pkg = example_pkg, target_folder = tempdir())


Converts the 'Rd' file into Quarto, and writes the file to a specified folder

Description

Converts the 'Rd' file into Quarto, and writes the file to a specified folder

Usage

write_reference_pages(
  pkg = ".",
  target_folder = NULL,
  examples = TRUE,
  not_run_examples = FALSE,
  template = NULL,
  quarto_file_path = NULL
)

Arguments

pkg

Path to the root of the R package. Defaults to ".".

target_folder

Path to the folder where the Quarto files will be written. Defaults to NULL, which resolves to "reference/" (or the dir value under pkgsite > reference in ⁠_quarto.yml⁠ if set).

examples

Flag that sets the examples code chunk to be evaluated when the Quarto document is rendered

not_run_examples

Flag that sets the "do not run" examples code chunk to be evaluated when the Quarto document is rendered

template

The path to a Quarto file that can be used as the template for all of the resulting reference files. If left NULL, pkgsite will use its default template.

quarto_file_path

Path to the folder containing ⁠_quarto.yml⁠. Use when the Quarto project root differs from the package root (e.g. the package lives in a sub-folder of a larger Quarto project). Must be a directory path. Defaults to NULL, in which case pkg is used.

Value

A set of Quarto files written to the specified path based on the number of Rd files in the package.

See Also

Other Quarto file creation: write_reference(), write_reference_index()

Examples


library(pkgsite)
example_pkg <- system.file("example", package = "pkgsite")
write_reference_pages(pkg = example_pkg, target_folder = tempdir())