documentation_to_markdown: Build a list of documentation files rendered out to markdown

View source: R/documentation_to_markdown.R

documentation_to_markdownR Documentation

Build a list of documentation files rendered out to markdown

Description

Build a list of documentation files rendered out to markdown

Usage

documentation_to_markdown(
  rdfilepaths,
  fragments = c("title", "usage", "description", "details")
)

Arguments

rdfilepaths

A character vector of Rd documentation file paths.

fragments

An optional vector of fragment tag names (such as "description", "details" or "title") to filter the Rd object tags.

Details

The function provides a vectorized way of extracting multiple documentation objects at once based on paths to the .Rd files sources. The file path will be truncated with basename, and used as a name for the output list. Use fragments parameter whenever you want to limit extracted documentation only to some parts.

Value

A named list of character vectors of length one with the markdown content. The names are dervied from the paths, see the details for more information.

See Also

rd2markdown get_rd

Examples


rd_file_example <- system.file("examples", "rd_file_sample.Rd", package = "rd2markdown")
rd_file_example_2 <- system.file("examples", "rd_file_sample_2.Rd", package = "rd2markdown")

# Extract full documentation for two files
rd2markdown::documentation_to_markdown(c(rd_file_example, rd_file_example_2))

# Limit to particular sections
rd2markdown::documentation_to_markdown(c(rd_file_example, rd_file_example_2),
  fragments = c("details"))


Genentech/rd2markdown documentation built on Feb. 28, 2025, 1:27 p.m.