astoff / devdocs.el

Emacs viewer for DevDocs
290 stars 17 forks source link

[Feature Request] Add a command that resembles `Info-toc` in `info-mode` #41

Open IceAsteroid opened 6 days ago

IceAsteroid commented 6 days ago

Hi, good day, everyone!

I found that it's hard to navigate through a document once I'm in the devdocs-mode.

There's a similar command devdocs-first-page, but it only goes to the first page of the document which also contains the table-of-contents, of course, but the point is lost track of the entry which is what previous page is.

If invoking Info-toc in an info buffer, it will display the table-of-contents also with a point at the last visited entry, which works better.

astoff commented 4 days ago

This is a reasonable request, but our possibilities are a little limited (we can only work with what devdocs.io gives us).

  1. There is the first document page, which often contains a TOC.
  2. There is the index (i in the DevDocs buffer).
  3. There is the page list (g in the DevDocs buffer).

Options 2 and 3 work in the minibuffer. If you use a package like Embark, you can export the options to an actual buffer to peruse. We could implement a slightly more refined version of the plain Embark export using the index hierarchy.

Unfortunately the hierarchy is flattened to 2 levels only by devdocs.io (document » chapter » entry), so we can't do anything fancier than that. Do you feel this is sufficiently useful?

IceAsteroid commented 2 days ago

Thank you for the answer!

Unfortunately the hierarchy is flattened to 2 levels only by devdocs.io (document » chapter » entry), so we can't do anything fancier than that. Do you feel this is sufficiently useful?

Yeah, understandable.

embark-export works good on this, it's better for browsing now!