Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nbenn/roxydocs
https://github.com/nbenn/roxydocs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nbenn/roxydocs
- Owner: nbenn
- License: other
- Created: 2022-02-17T13:33:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-17T13:37:08.000Z (almost 3 years ago)
- Last Synced: 2024-10-24T15:56:44.543Z (3 months ago)
- Language: R
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# roxydocs
In order to add documentation to [{cpp11}](https://cpp11.r-lib.org) wrapper functions, generated using [`cpp11::cpp_register()`](https://cpp11.r-lib.org/reference/cpp_register.html), this experimental package adds a [{roxygen2}](https://roxygen2.r-lib.org) tag, `@documents`, which can be used to specify one (or several) functions which are associated with an existing block of documentation.
Mimicking the style of documentation where functions with explicit `@rdname` tags are associated with a `NULL`-terminated dummy block as
```{r, eval = FALSE}
#' Basic arithmetic
#'
#' @param a,b numeric vectors.
#' @name arith
NULL#' @rdname arith
add <- function(a, b) a + b#' @rdname arith
times <- function(a, b) a * b
```the `@documents` tag attempts to create identical documentation without having to rely on `@rdname` tags.
```{r, eval = FALSE}
#' Basic arithmetic
#'
#' @param a,b numeric scalars.
#' @name arith
#' @documents add
#' @documents times
NULLadd <- function(a, b) a + b
times <- function(a, b) a * b
```# Disclaimer
This is not intended for production use, but was only created for exploring options for documenting [{cpp11}](https://cpp11.r-lib.org) wrapper functions.