KEMBAR78
Fix constant documents by soutaro · Pull Request #12357 · ruby/ruby · GitHub
Skip to content

Conversation

@soutaro
Copy link
Member

@soutaro soutaro commented Dec 16, 2024

This PR fixes two constant document issues:

RDoc doesn't generate docs for constants registered by rb_define_global_const

You can find the docs for ARGF, ARGV, ... are missing in Object docs.

スクリーンショット 2024-12-16 20 52 10

This is because rb_define_global_const is not supported in RDoc. This PR adds Document-const directive.

The generated docs have wired constant name duplication

Some constants defined in File::Constants has wired constant name duplication.

スクリーンショット 2024-12-16 20 53 25

I don't know the detail of the RDoc documentation generation, but I found the constant definition function calls (rb_file_const and rb_define_const) having Document-class: causes this issue. This PR drops the unnecessary Document-class: directives.

@nobu nobu added the Documentation Improvements to documentation. label Dec 16, 2024
nobu added a commit to nobu/rdoc that referenced this pull request Dec 16, 2024
@nobu
Copy link
Member

nobu commented Dec 16, 2024

RDoc doesn't generate docs for constants registered by rb_define_global_const

I think it is fixed now.

Those directives are attached to `rb_define_const` and `rb_file_const` where we don’t need them because the functions are supported by RDoc.
@soutaro
Copy link
Member Author

soutaro commented Dec 17, 2024

Thanks @nobu. Dropped the commit for rb_define_global_const. I hope the new version of RDoc will ship soon...

@soutaro soutaro merged commit c7a6387 into ruby:master Dec 17, 2024
41 checks passed
@soutaro soutaro mentioned this pull request Dec 17, 2024
@soutaro soutaro deleted the fix-docs branch December 17, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants