cnd_document {cnd} | R Documentation |
Document your conditions
Description
Documents your conditions()
and conditions()
Usage
cnd_document(
package = get_package(),
registry = package,
file = file.path("R", paste0(package, "-cnd-conditions.R")),
cleanup = TRUE
)
cnd_section(fun)
Arguments
package |
The package to document |
registry |
The name of the registry |
file |
The file to save the documentation. This can be a file path, a
connection object, or |
cleanup |
If |
fun |
The name of a function |
Value
-
cnd_document()
Conditional on thefile
argument:when
file
is a connection, the connection objectwhen
file
is a path, the pathwhen
file
isNULL
, acharacter
vector of the documentationif no conditions are found, a warning is thrown and
NULL
is returned
-
cnd_section()
Acharacter
vector of the documentation
conditions
Conditions are generated through the {cnd}
package.
The following conditions are associated with this function:
cnd:cnd_document_conditions/warning
cnd:cnd_document_file/error
cnd:cnd_document_pkg_reg/error
cnd:cnd_generated_cleanup/message
cnd:cnd_generated_write/condition
For more conditions, see: cnd-cnd-conditions
Examples
file <- file()
cnd_document("cnd", file = file)
readLines(file)
cnd_section("cnd")