roxygen2 7.3.0
New features
-
@docType packagenow works more like documenting"_PACKAGE",
creating a{packagename}-packagealias and clearly suggesting that
you should switch to"_PACKAGE"instead (#1491). -
_PACKAGEwill no longer generate an alias for your package name if
a function of the same name exists (#1160). -
The NAMESPACE roclet now reports if you have S3 methods that are missing
an@exporttag. All S3 methods need to be@exported (which confusingly
really registers the method) even if the generic is not. This avoids rare,
but hard to debug, problems (#1175). You can suppress the warning with
@exportS3Method NULL(#1550). -
The
NAMESPACEroclet once again regenerates imports before loading
package code and parsing roxygen blocks. This has been the goal for a long
time (#372), but we accidentally broke it when adding support for code
execution in markdown blocks. This resolves a family of problems where you
somehow bork yourNAMESPACEand can't easily get out of it because you
can't re-document the package because your code doesn't reload.
Minor improvements and bug fixes
-
If you document a function from another package it is automatically
imported. Additionally, if you set@rdnameor@nameyou can opt out
of the defaultreexportstopic generation and provide your own docs
(#1408). -
Generate correct usage for S4 methods with non-syntactic class names.
-
The
ROXYGEN_PKGenv var provides the name of the package being documented
(#1517). -
@describeIn foonow suggests that you might want@rdnameinstead
(#1493). It also gives a more informative warning if you use it with an
unsupported type (#1490). -
In
DESCRIPTION, URLs containing escapes inURLandBugReportsare
now correctly handled (@HenningLorenzen-ext-bayer, #1415). Authors can now
have multiple email addresses (@jmbarbone, #1487). -
escape_examples()is now exported (#1450). -
@exportS3Methodprovides the needed metadata to generate correct usage
for S3 methods, just like@method(#1202). -
is_s3_generic()now ignores non-function objects when looking for a
candidate function. I believe this is closer to how R operates. -
@importand friends are now ignored if they try to import from the
package being documented. This is useful to add self-dependencies in
standalone files meant to be used in other packages (r-lib/usethis#1853). -
@importFromthrows a friendlier error if you try and import a non-existing
functions (@MichaelChirico, #1409). -
@includenow gives an informative warning if you use a path that doesn't
exist (#1497). -
@inheritcan now also inherit from@format(#1293). -
@familylists are now ordered more carefully, "foo1" comes after "foo" (#1563, @krlmlr).