Skip to content

r-lib/doclisting

Repository files navigation

doclisting

doclisting automatically generates itemized lists of methods for a generic function, suitable for inclusion in roxygen2 documentation. Each method links to its help topic, and methods from other packages are clearly labeled.

Installation

You can install the development version of doclisting from GitHub:

pak::pak("hadley/doclisting")

Usage

methods_list() generates Rd markup listing all methods for a generic:

library(doclisting)
cat(methods_list("mean"))
#> \itemize{
#> \item \code{\link[Dates]{Date}}
#> \item \code{\link[mean]{default}}
#> \item \code{\link[difftime]{difftime}}
#> \item \code{\link[DateTimeClasses]{POSIXct}}
#> \item \code{\link[DateTimeClasses]{POSIXlt}}
#> \item \code{quosure}
#> }

You can use it in roxygen2 documentation in two ways:

  • Compute methods when the package is documented (i.e. at devtools::document() time), use inline R code in your roxygen comment:

    #' @description
    #' `r doclisting::methods_list("my_generic")`
    

    You’ll need to add doclisting to Suggests.

  • Compute methods when documentation is rendered (i.e. at ? time), use an Rd code block:

    #' @description
    #' `Rd doclisting::methods_list("my_generic")`
    

    You’ll need to add doclisting to Imports.

About

Tools to List Functions in Documentation

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages