[Solved] Mouseless docs.rs

#1

Is there a way to use docs.rs without the mice?

In particular, I’m looking for a set of hot keys for:

  1. search for crate
  2. search for function/struct/enum within crate
  3. moving up/dolwn the search results
  4. jumping around

On one hand, the UI seems to be built where lots of keyboard shortcuts are possible, but I can’t seem to find a “cohesive” set of keybindings to eliminate the mice entirely.

0 Likes

#2

If you’re just scripting a task, and have access to the browser, then tab and enter are all you should really need, although not really hotkeys.

1 Like

#3

I’m not automating anything yet (though perhaps I should).

This is purely for human/manual navigation.

What I don’t like about tab/shift-tab is that it’s linear in the number of clickable things, so it’s pretty slow to move around (compared to mice).

I was thinking more along the lines of Emac’s https://github.com/emacs-helm/helm or https://github.com/abo-abo/avy

which easily lets me jump to the function/struct/enum I care about.

1 Like

#4

There’s a few longstanding bugs in docs.rs related to keyboard accessibility.

2 Likes

#5

I think here’s an interesting thought experiment: given a list of package/function-struct-enum names, what UI would allow one to jump to the definition in the least number of keystrokes.

Tab/Shift-tab would probably not be part of that UI.

docs.rs shows promise, but I’m not sure if it can be used as such a UI.

Ideally, the UI would be something like:

  1. I start typing part of crate name
  2. There’s an auto completion of possible crate names
  3. There’s a way to select a crate name

===

  1. Now, I start typing a function/struct/enum name
  2. There’s an auto completion of possible crate names
  3. There’s a way to select a function/struct/enum
0 Likes

#6

Hmm, if your bug from 2.5 years ago isn’t fixed, it’s unlikely the keyboard shortcuts I want will be supported anytime soon.

Suggestions for docs.rs alternatives?

0 Likes

#7

Local rustdoc (accessible using cargo doc --open) actually has pretty good keyboard support. If you press ?, it gives you a list of existing keyboard shortcuts, which includes one to jump to the search bar. It’s just the docs.rs-specific stuff that has the major bugs.

3 Likes

#8

cargo doc --open is very cool. Thanks!

0 Likes

#9

I generally use Tridactyl (in Firefox, Vimium in Chrome) to browse any web site with the keyboard. Docs.rs works well with those.

3 Likes