|
41 | 41 |
|
42 | 42 | ## R6 |
43 | 43 |
|
44 | | -* R6 method usage now shows `ClassName$new(args)` for constructors and `obj$method(args)` for other methods, making it clearer how each method is actually called (#1026). |
| 44 | +There are two new ways to document methods outside of the class definition: |
| 45 | + |
45 | 46 | * Methods added via `$set()` can now be documented by placing a roxygen block directly above the `$set()` call (#931). |
46 | | -* New `@R6method Class$method` tag allows you to document R6 methods anywhere, in case you are generating them in a way that roxygen2 doesn't currently recognize (#991). |
47 | | -* `@returns` now works as a method-level tag in R6 classes, just like `@return` (#1148). |
| 47 | +* `@R6method Class$method` is a new tag that allows you to document R6 methods anywhere, in case you are generating them in a way that roxygen2 doesn't currently recognize (#991). |
| 48 | + |
| 49 | +Classes now inherit more from their parents: |
| 50 | + |
| 51 | +* R6 subclass methods now automatically inherit parameter documentation from the same-named superclass method when parameters are not documented locally. Fields and active bindings also inherit documentation from superclasses (#996). |
| 52 | + |
| 53 | +And you can choose to suppress documentation for individual fields and methods: |
| 54 | + |
| 55 | +* `@noRd` before an R6 method now suppresses its documentation, and `@field name NULL` suppresses documentation for a field or active binding (#1067). |
| 56 | + |
| 57 | +There was also large number of bug fixes and minor improvements: |
| 58 | + |
| 59 | +* Inherited method links now only link to parent classes that have documentation, avoiding broken links when parent classes are undocumented (#963, #1155). |
| 60 | +* R6 classes with only active bindings and `cloneable = FALSE` no longer error during documentation (#1610). |
| 61 | +* R6 method examples displayed in method subsections now strip `\dontrun{}`, `\donttest{}`, and `\dontshow{}` wrappers, since these Rd macros are not interpreted inside `\preformatted{}` blocks (#1072). |
48 | 62 | * The "Super classes" section now omits the `pkg::` prefix for parent classes from the same package, making the inheritance chain easier to read (#1567). |
49 | 63 | * `@description` and `@details` for R6 methods now support markdown headings (#1647). |
50 | | -* `@field` with comma-separated names (e.g., `@field var_1,var_2 description`) no longer produces spurious warnings about undocumented active bindings or unknown fields (#1600). |
51 | | -* R6 classes with only active bindings and `cloneable = FALSE` no longer error during documentation (#1610). |
52 | 64 | * `@example` (singular, with a file path) now works correctly in R6 class documentation (#1158). |
53 | | -* R6 method examples displayed in method subsections now strip `\dontrun{}`, `\donttest{}`, and `\dontshow{}` wrappers, since these Rd macros are not interpreted inside `\preformatted{}` blocks (#1072). |
54 | | -* You can now use `@noRd` before an R6 method to suppress its documentation, and `@field name NULL` to suppress documentation for a field or active binding (#1067). |
55 | | -* Inherited method links now only link to parent classes that have documentation, avoiding broken links when parent classes are undocumented (#963, #1155). |
| 65 | +* `@field` with comma-separated names (e.g., `@field var_1,var_2 description`) no longer produces spurious warnings about undocumented active bindings or unknown fields (#1600). |
| 66 | +* `@returns` now works as a method-level tag in R6 classes, just like `@return` (#1148). |
56 | 67 | * `initialize()` method parameters now automatically inherit documentation from `@field` tags with the same name, reducing the need to duplicate descriptions. Explicit `@param` tags still take precedence (#1004). |
57 | | -* R6 subclass methods now automatically inherit parameter documentation from the same-named superclass method when parameters are not documented locally. Fields and active bindings also inherit documentation from superclasses (#996). |
| 68 | +* R6 method usage now shows `ClassName$new(args)` for constructors and `obj$method(args)` for other methods, making it clearer how each method is actually called (#1026). |
58 | 69 |
|
59 | 70 | ## S7 |
60 | 71 |
|
|
0 commit comments