Added functionality to document R6classes using docblocks that allow … #465
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wanted to make a suggestion on how to document R6 classes.
It is mostly in its basic functionality copied from how roxygen handles rc classes, but expanded from there on how the documentation works.
In each R6class-method, it still uses docstrings for documentation, like RC classes. However, instead of a single string, it also accepts several of them - i.e. a docblock as several docstrings.
Inside the docblock, @param lines are allowed that specify parameters.
In the documentation, the methods are set as follows:
Usage:
.... usage string of method ...
Description of method
If parameters were specified, this is followed by a
Parameters:
\describe-block with one \item per parameter.
It keeps the documentation for all methods together in a block and allows for more detail on how to document the parameters. usually, the documentation of each method will still be only 5 lines or so, so while it gets longer, it isn't excessively so.