Skip to content

Context information for roxygen2 documentation blocks #516

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

Closed
krlmlr opened this issue Sep 27, 2016 · 2 comments
Closed

Context information for roxygen2 documentation blocks #516

krlmlr opened this issue Sep 27, 2016 · 2 comments
Labels
feature a feature request or enhancement

Comments

@krlmlr
Copy link
Member

krlmlr commented Sep 27, 2016

Last time I looked, the documentation blocks were available as a character vector, without context information. I wonder if we could add context information to each line processed, to support inline parameter documentation and R6 documentation (#306):

#' Some function 
fun <- function(
  a, #' description of argument a
  b = NULL) #' description of argument b
{
  ret <- process_it(a, b)
  ret #' a character vector
}

would be equivalent to

#' Some function
#' @param a description of argument a
#' @param b description of argument b
#' @return a character vector

This came up on the @RDocTaskForce mailing list.

@hadley
Copy link
Member

hadley commented Sep 28, 2016

I'm largely in favour of this, as long as it doesn't make the internals a lot more complicated.

@hadley hadley added the feature a feature request or enhancement label Dec 29, 2016
@hadley
Copy link
Member

hadley commented Aug 21, 2017

I think this is basically done - the roxy_block class stores filename and line number, so you should be able to recreate the context if needed. Once you figure out exactly what you need, I'll be happy to review a PR that extends roxy_block with new fields.

@hadley hadley closed this as completed Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants