Skip to content

Documentation for R6 methods added dynamically by "$set()" #931

@coolbutuseless

Description

@coolbutuseless

I've just converted minihtml over to latest roxygen2 from github to test out the R6 support and it's working pretty well.

One challenge at the moment is that I generate many R6 methods for HTMLElement class dynamically using HTMLElement$set("public", method_name, method). I can not see any way to generate documentation for these methods and roxygen is very noisy in telling me that neither the methods nor any of their arguments are documented!

Click to see section of warnings generated during documentation step
(... snipped a 100 lines at the start ...)
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `title()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `tr()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `track()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `tt()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `ul()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `var()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `video()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] `wbr()`: undocumented R6 method
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] argument `...` undocumented for R6 method `a()`
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] argument `href` undocumented for R6 method `a()`
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] argument `hreflang` undocumented for R6 method `a()`
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] argument `media` undocumented for R6 method `a()`
Warning: [/Users/mike/projects/minihtml/R/HTMLElement.R:1] argument `rel` undocumented for R6 method `a()`

(... snipped a few hundred lines at the end ...)

Questions:

  • Is there a way to document methods added dynamically with a $set()?
  • Is there a way to tell roxygen2 to be quieter about missing documentation for methods?
  • Is there a way to tell roxygen2 that although some methods are public I do not want to include them in the documentation?

Sidenote: Whether or not it's a good idea to generate a method for each of the ~100 HTML tags is a different conversation :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions