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

Provide easy way to open associated RDoc? #996

Open
mperham opened this issue Aug 29, 2024 · 2 comments
Open

Provide easy way to open associated RDoc? #996

mperham opened this issue Aug 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mperham
Copy link

mperham commented Aug 29, 2024

This issue is based on a Mastodon thread here:

https://ruby.social/@getajobmike/113047521307357054

Today it is really difficult to find the documentation for most Ruby methods. There are old sites like apidock.com which still rank high. Ruby's dynamic typing makes it difficult to find the root location for a method. Even a tool like ri fails:

> ri SecureRandom.base64
Nothing known about SecureRandom.base64

I'd like to see a way for the user to open a corelib or stdlib method's rdoc from irb, for example:

open SecureRandom.method(:base64).rdoc_url

and this could open:

https://docs.ruby-lang.org/en/master/Random/Formatter.html#method-i-base64

One issue I can envision: what about other classes/modules for 3rd party code?

You could use a simple heuristic based on the source location to determine if this is a core code or not, e.g. "/Users/mperham/.rubies/ruby-3.3.3/lib/ruby/3.3.0/random/formatter.rb". If core, you can direct to "docs.r-l.org/$lang/$ver/...", a gem might go to "docs.rubygems.org/$gemname/$gemver/...".

What do you think? How else can we improve RDoc accessibility?

@st0012
Copy link
Member

st0012 commented Aug 29, 2024

I think it's a great idea and I can make a prototype soon.

@st0012 st0012 added the enhancement New feature or request label Aug 29, 2024
@mperham
Copy link
Author

mperham commented Aug 29, 2024

I think rubygems have an rdoc_url element in the gemspec. That could be another piece of the puzzle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants