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
Apply :nodoc:
to nested classes and modules [ci-skip]
#44506
base: main
Are you sure you want to change the base?
Apply :nodoc:
to nested classes and modules [ci-skip]
#44506
Conversation
When `:nodoc:` is applied to a class / module, RDoc will still document nested classes / modules, unless `:nodoc:` is applied to them as well. Additionally, if `:nodoc: all` is applied to a class / module that contains nested classes / modules, like so: ```ruby class Foo # :nodoc: all def foo_method; end class Bar def bar_method; end end end ``` RDoc will still include the outer class / module (e.g. `Foo`) in the doc index, albeit as an empty namespace. Furthermore, SDoc will include both outer and inner (e.g. `Foo` and `Bar`) in the index as empty namespaces. However, when `:nodoc:` is applied at all levels, like so: ```ruby class Foo # :nodoc: def foo_method; end class Bar # :nodoc: def bar_method; end end end ``` Both RDoc and SDoc include neither outer nor inner in the index.
Is that expected behaviour of |
It might be. I wasn't planning to dig into it, but if someone wants to tackle it, I can convert this PR to apply |
SDoc is still pinned to an older version of RDoc: |
@p8 Do you know if that would avoid including both I originally did try to diagnose whether the issue was from RDoc or SDoc. When I used just RDoc v6.3.3 without SDoc (via the |
FWIW, it seems RDoc intentionally leaves nested classes/modules as documented even when using
|
When
:nodoc:
is applied to a class / module, RDoc will still document nested classes / modules, unless:nodoc:
is applied to them as well. Additionally, if:nodoc: all
is applied to a class / module that contains nested classes / modules, like so:RDoc will still include the outer class / module (e.g.
Foo
) in the doc index, albeit as an empty namespace. Furthermore, SDoc will include both outer and inner (e.g.Foo
andBar
) in the index as empty namespaces.However, when
:nodoc:
is applied at all levels, like so:Both RDoc and SDoc include neither outer nor inner in the index.