Skip to content
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

Support permalinking constants #357

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

jonathanhefner
Copy link
Member

This adds a permalink next to each constant's name, similar to methods. This also adds a "Constants" navigation section in the sidebar, similar to the "Methods" navigation section.

The permalinks are implemented by monkeypatching RDoc::Constant to provide an aref method, just as RDoc::ClassModule and RDoc::MethodAttr already do.

Before After
before after

This adds a permalink next to each constant's name, similar to methods.
This also adds a "Constants" navigation section in the sidebar, similar
to the "Methods" navigation section.

The permalinks are implemented by monkeypatching `RDoc::Constant` to
provide an `aref` method, just as `RDoc::ClassModule` and
`RDoc::MethodAttr` already do.
@jonathanhefner jonathanhefner merged commit 22657f7 into rails:main Jan 4, 2024
9 checks passed
@p8
Copy link
Member

p8 commented Jan 5, 2024

This is great.
I've tried to get this upstreamed in RDoc without much success.
ruby/rdoc#1016
Maybe this change helps.

@jonathanhefner
Copy link
Member Author

I've tried to get this upstreamed in RDoc without much success.
ruby/rdoc#1016
Maybe this change helps.

Yes, I don't understand why that PR was rejected. There are several things which I think should be fixed upstream in RDoc. However, the friction seems to be quite high, and I don't want to block improvements to SDoc. Perhaps SDoc can serve as a good example though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants