Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jjspace
Copy link
Contributor

@jjspace jjspace commented Feb 13, 2025

Description

I'm the type of person that prefers to use keyboard shortcuts and naviation as much as possible. It's become extremely common to have Ctrl+K initiate a search in library documentation. Some examples: ESLint, React, Prettier. I don't know them by name but I'd assume most "doc generation" libraries offer this option at this point.

This PR adds this shortcut as an option to our own docs.
It also opens the first "result"/item in the sidebar when hitting enter while the class filter is focused.

These two small changes make it sooo much nicer to quickly jump around different pages of docs if you know the name. There's likely many other changes we could do to improve our documentation (like searching properties??) but this seemed like a very small but quick win.

Demo:

simplescreenrecorder-2025-02-13_13.22.18.mp4

Issue number and link

No issue

Testing plan

  • run npm run build-docs
  • npm start and open the docs page locally
  • Hit Ctrl+k and make sure it focuses the search on the home page and class pages
  • Hit enter and make sure it opens the first result
  • Make sure the new keyboard shortcut indicators show up nicely on all pages.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

@jjspace jjspace force-pushed the documentation-shortcut branch from 714fcca to 8bb9d95 Compare February 18, 2025 19:15
@ggetz
Copy link
Contributor

ggetz commented Feb 20, 2025

Nice, everything here is working as described. Thanks @jjspace!

@ggetz ggetz added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit bf674f2 Feb 20, 2025
5 checks passed
@ggetz ggetz deleted the documentation-shortcut branch February 20, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants