emanote icon indicating copy to clipboard operation
emanote copied to clipboard

TOC sidebar

Open srid opened this issue 4 years ago • 4 comments
trafficstars

When rendering Pandoc, provide a way to include table of contents automatically.

Inspiration / Example - https://fs.blog/mental-models/

  • [ ] Spec it out. Pandoc filter? How does Obsidian do it? etc.

srid avatar May 20 '21 04:05 srid

Another inspiration, one that embeds ToC in the sidebar itself.

https://www.unisonweb.org/docs/tour

This one looks pretty cool.

EDIT: Looks like the page has changed.

srid avatar Jun 11 '21 01:06 srid

I like the Unison example. Ping @lucasvreis if you have any new ideas (for navigating large Org doc)?

srid avatar Jun 18 '22 22:06 srid

I like the sidebar TOC. I'm no designer, but since you asked for ideas... for really large docs meant to be read in a non-linear way it may help to have the sidebar fixed (I'm thinking of https://tecosaur.github.io/emacs-config/).

In emacs itself I navigate most org files with consult-imenu, but it'd be a bit odd to do this in a web page (or just too much work to implement 🙃).

Edit: not really a TOC, but org users are used to fold the headings, at least in emacs. That's what I'm doing in the abacateiro example. In a sense it also works as a TOC when fully folded.

estradilua avatar Jun 18 '22 23:06 estradilua

for really large docs meant to be read in a non-linear way it may help to have the sidebar fixed (I'm thinking of https://tecosaur.github.io/emacs-config/).

The right-side sidebar on this link is exactly what I think we should have for Emanote as well. I wonder if the CSS/JS for this comes ready-made (as in, as a generic JS library) somewhere ... ~~otherwise, we may have to reverse-engineer @tecosaur's site and write it by hand.~~

EDIT: Just discovered this small demo: https://codepen.io/pubwriter/pen/ZgLzYV

srid avatar Jun 19 '22 01:06 srid

Another example (a well-known one at that), Docusaurus: https://docusaurus.io/docs

srid avatar Dec 06 '23 01:12 srid

I guess we would need two kinds of TOC sidebar, one for a single document and one that spans across multiple document?

TristanCacqueray avatar Jan 21 '24 23:01 TristanCacqueray

Just TOC for current document is sufficient.

I don't know what a TOC spanning multiple documents would look like.

srid avatar Jan 22 '24 05:01 srid

I thought that was the case for unisonweb, but it looks like their sidebar no longer have a TOC for the current page.

So in term of implementation, do you think this needs a new <ema:note:toc> splice with the heading defined as a tree that could be rendered using a toc template similar to the pandoc.tpl?

Or perhaps the TOC could be pre-rendered using <ul> and <li> and the user would tweak the rendering with css?

For what it's worth, I gave this a try by generating the template for https://tristancacqueray.github.io/snippets that way: renderToc

TristanCacqueray avatar Jan 22 '24 12:01 TristanCacqueray

In terms of implementation, I'd say the former is ideal - though not necessarily in pandoc.tpl. It would be similar to how the sidebar tree is implemented.

srid avatar Jan 22 '24 13:01 srid

The TOC can be on the right side, btw. Like the emacs-config and docusaurus example. The unison page looked different when I posted that comment.

srid avatar Jan 22 '24 13:01 srid

Ok great, I'll take a stab at it, this looks similar to #480 , so I might as well do this while my heist skills are still fresh :)

TristanCacqueray avatar Jan 22 '24 14:01 TristanCacqueray