Searching Ruby's documentation
The official Ruby docs are at https://docs.ruby-lang.org/en/. This documentation (and any documentation built with rdoc 6.15.0 or greater) now can be searched using a query parameter. Check it out!
https://docs.ruby-lang.org/en/master/?q=String%23gsub
I added this to RDoc because I was fed up with accidentally ending up on a horrible 3rd party website I won’t name with 8+ year stale docs that Google inexplicably prioritizes.
If you use Kagi Search you can now search !rb
String#gsub
and it will take you directly to the result.
I appreciate that Kagi’s “bangs” are open source and accept contributions, but you don’t need to sign up for a service to have this ability. It seems a bit odd to me anyway to make an HTTP request just to be immediately redirected to another. Instead you can configure this right in your browser.
In Firefox, go to Settings > Search > Search Shortcuts > Add. Use https://docs.ruby-lang.org/en/master/?q=%s
as the URL and whatever you want as the keyword (I like !rb
).
In Chrome, essentially the same thing is at Settings > Search Engine > Manage search engines and site search > Site search > Add. The values work the same as for Firefox.
Stan Lo is also working on improving the quality of the results, so if you find the search underwhelming please check again once that’s shipped!
Happy searching!