roxy_blocks: Get roxygen2 blocks

roxy_blocksR Documentation

Get roxygen2 blocks

Description

[Experimental]

Parses the roxygen2 package documentation of a specific R package or from a single .R source code file.

Usage

roxy_blocks(pkg = NULL, ..., text = NULL, quiet = TRUE)

Arguments

pkg, text

Either a package name (pkg) or a character vector of R source code lines (text) to extract the object's roxygen2 tag value from.

...

Further arguments passed on to utils::download.packages(), excluding "pkgs", "destdir", "available", "type" and "quiet". Only relevant if pkg is provided.

quiet

Whether or not to suppress printing status output from internal processing.

Value

A list of roxy_block objects.

See Also

Other package documentation functions: enum_fn_param_defaults(), fn_param_defaults(), roxy_obj(), roxy_tag_value(), roxy_to_md_links()

Examples

# Either provide an R source file as a character vector `text`...
text <- readr::read_lines(paste0("https://raw.githubusercontent.com/r-lib/rlang/",
                                 "db52a58d505b65f58ba922d4752b5b0061f2a98c/R/fn.R"))

pal::roxy_blocks(text = text) |> head(n = 3L)

# ...or provide a package name as `pkg`
try(
  pal::roxy_blocks(pkg = "tinkr",
                   repos = "https://cloud.r-project.org") |>
    head(n = 3L)
)

salim-b/pal documentation built on Feb. 28, 2025, 6:51 p.m.