-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@inheritParams with NULL doc targets #836
Comments
roxygen2 doesn't parse the usage block, so it doesn't know what the usage is, and hence it doesn't find any parameters to inherit. I think we could make this a warning. |
Minimal reprex: library(roxygen2)
out <- roc_proc_text(rd_roclet(), "
#' First function
#'
#' @name fun1
#' @usage fun1(x)
#' @param x x
NULL
#' Second function
#'
#' @name fun2
#' @usage fun2(x, y)
#' @inheritParams fun1
NULL
") Created on 2019-08-22 by the reprex package (v0.3.0) |
Thanks for creating the reprex, I didn't have enough knowledge to know how. As for inheriting params when using a
Other ideas? Or recent techniques for documenting R6 objects I might have missed? |
I don't think it's worth building out a bunch of special purpose functionality to support documenting R6 objects; instead it would be better to build a standard way of documenting R6 objects. |
Seems good in theory, but there's not really even a standard way of creating R6 objects, which seems like it would make roxygen's job of auto-parsing it out of the code kind of tough. Maybe there's some way to standardize both of them together and make the whole schmeer more pleasant. I've thought about working on "nicer" ways to create R6 stuff but haven't done much yet. |
due to this issue: r-lib/roxygen2#836
Rely on various modern roxygen2 features to simplify and streamline documentation and reduce duplications. There were also a bunch of documentation errors/mistakes that this PR fixes as well as various spelling harmonizations. Note that unfortunately we can't use `@inheritParams` [since](r-lib/roxygen2#836 (comment)) > roxygen2 doesn't parse the usage block, so it doesn't know what the usage is, and hence it doesn't find any parameters to inherit. Instead we use `@eval` to minimize duplication, cf. https://roxygen2.r-lib.org/articles/rd.html#evaluating-arbitrary-code Also note that Markdown support in roxygen2 documentation tags is now enabled globally for the whole package which means percentage signs mustn't be escaped anymore.
I have the following docs:
The
@inheritParams
directive doesn't have the desired effect, no parameters are inherited fromfuncOne
:Some notes:
@inheritParams
to something bogus like@inheritTheWind
, I get a properWarning: @inheritTheWind [/Users/kwilliams/git/GroveR/R/docs-test.R#25]: unknown tag
, so I do know the original tag is at least being recognized as legitimate@inheritParams funcOne
to a bogus@inheritParams foo
, no warning is printed - this makes me suspect my original example is silently not finding thefuncOne
parameters too.So two questions:
@inheritParams
can't find the specified target, can it spit out a warning/error that might help track down the problem?Thanks.
(NB- this issue adapted from #835. I'm trying to use this
NULL
style of docs because the things I'm documenting are actually R6 objects defined a particular way.)The text was updated successfully, but these errors were encountered: