emanote
emanote copied to clipboard
TOC sidebar
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.
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.
I like the Unison example. Ping @lucasvreis if you have any new ideas (for navigating large Org doc)?
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.
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
Another example (a well-known one at that), Docusaurus: https://docusaurus.io/docs
I guess we would need two kinds of TOC sidebar, one for a single document and one that spans across multiple document?
Just TOC for current document is sufficient.
I don't know what a TOC spanning multiple documents would look like.
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
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.
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.
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 :)