Skip to content

Unhide RDoc documentation from top level Gem module#5396

Merged
deivid-rodriguez merged 1 commit intoruby:masterfrom
nobu:ignored-doc
Mar 14, 2022
Merged

Unhide RDoc documentation from top level Gem module#5396
deivid-rodriguez merged 1 commit intoruby:masterfrom
nobu:ignored-doc

Conversation

@nobu
Copy link
Copy Markdown
Member

@nobu nobu commented Mar 12, 2022

What was the end-user or developer problem that led to this PR?

The Gem module is not listed in the “Class and Module Index” at all.

What is your fix for the problem, implemented in this PR?

Move :stopdoc: directive at the top level in lib/rubygems/compatibility.rb in the module block.
If this is at the top level, it stops the documentation of the entire module, but not only the part in this file.

Make sure the following tasks are checked

If this is at the top level, it stops the documentation of the
entire module, but not only the part in this file.
@deivid-rodriguez
Copy link
Copy Markdown
Contributor

We discussed something somewhat similar at #5299, any ideas to prevent this kind of issue from being reintroduced?

@nobu
Copy link
Copy Markdown
Member Author

nobu commented Mar 13, 2022

Although rdoc --verbose shows a module Gem (undocumented) line, this is buried in a lot of similar messages.
I guess rdoc may be possible to warn when already documented class/module is ignored.
Or, simple git grep '^# *:stopdoc:' -- '*.rb' may help in many cases.

@deivid-rodriguez
Copy link
Copy Markdown
Contributor

I run rdoc --verbose and I get three "module Gem (undocumented)" messages with or without this PR.

@nobu
Copy link
Copy Markdown
Member Author

nobu commented Mar 13, 2022

I think this is a bug of rdoc, a :stopdoc: in a file should not affect the same class/module in other files.

@deivid-rodriguez
Copy link
Copy Markdown
Contributor

@nobu I'm looking into this and I'm not seeing the missing Gem module. When I run rdoc and open the generated docs, the Gem module is listed under "Class and Module Index". 🤔

@nobu
Copy link
Copy Markdown
Member Author

nobu commented Mar 14, 2022

Snapshot of the part of https://docs.ruby-lang.org/en/master/: image
The next to GC::Profiler is Gem::AvailableSet, there should be Gem between them.

@deivid-rodriguez
Copy link
Copy Markdown
Contributor

My bad.

Locally I get a slightly different result where namespaces are collapsed by default. So Gem is listed because it wraps other classes. However, unlike other namespaces, it's not clickable so docs are not generated for it.

Captura de pantalla 2022-03-14 a las 17 15 24

After this PR, it becomes clickable

Captura de pantalla 2022-03-14 a las 17 14 37

@deivid-rodriguez deivid-rodriguez changed the title Move :stopdoc: directive Unhide RDoc documentation from top level Gem module Mar 14, 2022
@deivid-rodriguez deivid-rodriguez merged commit 9825d7f into ruby:master Mar 14, 2022
@nobu nobu deleted the ignored-doc branch March 14, 2022 16:21
deivid-rodriguez added a commit that referenced this pull request Mar 23, 2022
Unhide RDoc documentation from top level `Gem` module

(cherry picked from commit 9825d7f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants