Search automatically on ?q= URL query parameter#1396
Conversation
Automatically start searching when ?q= parameter is given in the URL, selecting and visiting the first match if available. If not available, the query will be filled into the search box but we won't navigate away.
|
🚀 Preview deployment available at: https://28a79875.rdoc-6cd.pages.dev (commit: df0cf11) |
|
Accepting |
SDoc does this using turbolinks, which I think works extremely well in the docs, but is a bit more than I wanted to do in this PR. How's this? I made it so that the page we jump to is given |
|
CI failure is unrelated. |
The latest version of RDoc has a built-in javascript powered search, similar to what !rails does, and Ruby just upgraded to it. This should delivery better results than the google search. ruby/rdoc#1396 https://docs.ruby-lang.org/en/master/?q=String#gsub
Fixes #1319 (I wanted this for exactly that reason 😅)
Automatically start searching when ?q= parameter is given in the URL, selecting and visiting the first match if available.
If not available, the query will be filled into the search box but we won't navigate away.
This should enable configuring a generated rdoc page as a search engine in one's web browser, or as a bang command in a search engine. For reference Rails' sdoc (which I think rdoc's search is originally based on) does this: https://api.rubyonrails.org/?q=changed%3F