Skip to content

Proposal: Add shortcut for switching to other docs on hexdocs.pm #1008

@cybrox

Description

@cybrox

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 to hexdocs.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? :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions