Skip to content

Search automatically on ?q= URL query parameter #1396

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhawthorn
Copy link
Member

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

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.
@jhawthorn jhawthorn temporarily deployed to fork-preview-protection July 29, 2025 23:11 — with GitHub Actions Inactive
@matzbot
Copy link
Collaborator

matzbot commented Aug 3, 2025

🚀 Preview deployment available at: https://bfd86835.rdoc-6cd.pages.dev (commit: bd3ba77)

@st0012 st0012 self-requested a review August 4, 2025 00:07
@st0012
Copy link
Member

st0012 commented Aug 4, 2025

Accepting ?q= will be a big improvement ❤️
But is it possible to keep the search results open even after jumping like SDoc does?
If that's too complicated (I tried it a bit but failed) due to how darkfish works, I'd prefer not jumping immediately (or only jump when there's exactly one result), so we can show the results dropdown.

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

Successfully merging this pull request may close these issues.

Add support for reading search term from query param
3 participants