rails / sdoc

Standalone sdoc generator
http://api.rubyonrails.org/
Other
823 stars 131 forks source link

Support permalinking constants #357

Closed jonathanhefner closed 6 months ago

jonathanhefner commented 6 months ago

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
p8 commented 6 months ago

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

jonathanhefner commented 6 months ago

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.