-
Notifications
You must be signed in to change notification settings - Fork 482
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
Added keyboard shortcut for search box #2027
Conversation
- Added .vscode to .gitignore
How can I get that one job to be successful? Is this PR accepted and be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
-
I was wondering if we could have a small gray text in the search box, indicating the you can use Ctrl + / for the search? I think it would greatly help with the discoverability of this feature. Like in the Tailwind docs:
I guess it should be doable with some simple CSS maybe? But happy to merge as is too.
-
Could you add a brief note into
CHANGELOG.md
, with a reference to this this PR and the related issue?
Ah, yeah, I forgot we show that text. That would be perfect. Probably just |
Alright, will do the changes and make the commit. |
- Changed placeholder to indicate the shortcut use - Added the change in `CHANGELOG.md` - Made the suggested edits in `.gitignore`
- Changed placeholder to indicate the shortcut use - Added the change in `CHANGELOG.md` - Made the suggested edits in `.gitignore`
@mortenpi I have made the suggested changes and some improvements to the method too.
|
Why was Ctrl+/ chosen for this? |
I didn't chose any single Alphanumeric character to avoid triggering the script while still being in the input.(For example, letter For this reason, I assumed that a combination of keys would be ideal rather than any single character. Hope it clears up. |
Fair question. Looking through a few sites, it doesn't look like there is massive consensus about this. GitHub uses just |
On many keyboards |
We could maybe follow GitHub's lead and use just |
@mortenpi @fredrikekre Is there a final combination in mind? P.S.: It can be changed into whichever combination(s) we like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try with Ctrl + /. If people prefer something else I think it would be perfectly fine to change this without requiring a breaking Documenter version.
@@ -1,3 +1,5 @@ | |||
.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind that this is added, but note that you can use a global gitignore file for things that are personal (i.e. editor/workflow specific things). See e.g. https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer.
After merging this I have noticed that Ctrl+K seems to be very common. Perhaps Documenter should update to that? |
I would be fine with that. I have also seen that used on some sites. |
Just one more data point: apparently MultiDocumenter sites have a shortcut (to the MultiDocumenter global search) and use |
Also, added .vscode to .gitignore
Link to keyboard shortcut is here.
To focus into search bar press
ctrl
+/
orcmd
+/
keys.To focus out of search bar press
Esc
key.Edit by @mortenpi: close #1536.