-
Notifications
You must be signed in to change notification settings - Fork 350
Description
My biggest annoyance when using hexdocs while working is switching between different project's documentations. I usually solve this by keeping multiple tabs open and having bookmarks for the documentations that I often use. So I was thinking if there isn't an easier way for solving this.
To keep things short, my proposal here would be to:
- Make the docs aware as to wether or not they are viewed via hexdocs or not (using
window.location.hostname
for example) - If we are viewing the published documentation, a new keyboard shortcut
g
is added for "going to" another documentation - Pressing
g
opens a modal with a search field (like the shortcut help modal), where the name of another project can be entered (e.g.ecto
) and hitting enter will redirect tohexdocs.pm/<project>
This is very bare-bones and I wrote a patch to do this in 5 minutes, but I didn't want to PR it yet, because I wanted to get feedback on the proposal first. - Also, I did search GH issues and didn't find anything but maybe a similar proposal was around already?
Ok, for improving usability of this feature a bit:
- The search input in the goto modal could feature autocomplete, although neither hex nor hexdocs currently do this for their search fields. (I assume for traffic reasons?)
- The search input could also support linking to a module directly, by using a syntax like
projectname.module
(e.g.plug.conn
)
What bugs me a bit about adding this to ex_doc:
- It is useless in ex_doc itself, ideally, this would be injected by hexdocs when rendering the docs but as far as I can see, this is currently not done with anything, the docs are just fetched from a bucket and displayed as they are.
Does anyone else think this would be useful or am I off track with this one? :)