Convert a package codebase into applicable roxytypes tags. For roxygen2
tags with drop-in replacements (namely @param and @return tags), process
descriptions and replace tags with roxytypes equivalents.
Usage
convert(
path = ".",
format = config(path, refresh = TRUE, cache = FALSE)$format,
...,
unmatched = FALSE,
verbose = interactive()
)Arguments
- path
(
character[1]) A file path within your package. Defaults to the current working directory.- format
(
character[1]) Aglue-style format to use to parse types and descriptions for conversion toroxytypestags. Availablegluekeywords includetypeanddescription. By default,typewill match any string until a closing backtick anddescriptionwill match any string. See details for more information.- ...
Additional arguments passed to
build_format_regex().- unmatched
(
logical[1]) Indicates whether tags that fail to match should still be converted intoroxytypestags. Such conversions may be convenient if you aim to convert your package holistically, as it will help to flag undocumented parameter types the next time you re-build your documentation.- verbose
(
logical[1]) Indicates whether command-line interface should be emitted so that changes can be reviewed interactively.
Details
A format string is built using build_format_regex(), which accepts
parameters type and description, which describe how to match these
components of a parameter definition. They are combined with the literal
content of format to produce a regular expression to split existing
definitions.
For comprehensive control, pass format_re directly, bypassing expression
construction altogether.