Adding the lines below in the editor does nothing.
<!-- toc -->
<!-- tocstop -->
The option to add TOC is not available in the menu bar.
Ctrl + Shift + T changes the view. It no longer generates table of content like it did with old boostnote.
Implementing TOC generation sounds good to me. But I don't think using <!-- toc --> comment is a good idea. To update TOC, the app will modify content of a note again right after editing any headers in the notes. And I don't think the storage need to store the side effect changes. It would make Editor UX and Edit history of the note messier. So I think we need something different. Please let me explain what I'm thinking now.
Provide ToC UI so you can navigate a note without generating TOC.
Using https://github.com/djm/remark-shortcodes, we could introduce new syntax like [[TOC]].
Original content
[[TOC]]
# AAA
# BBB
# CCC
Processed content(This will be rendered on preview and exported)
- [AAA](#aaa)
- [BBB](#bbb)
- [CCC](#ccc)
# AAA
# BBB
# CCC
<!-- toc --> <!-- tocstop -->
I was just referring to how it looked like in the old boostnote. I love the idea of having a TOC shortcode to keep it simple.
@themattgabriel
Awesome! Then, I'll try to implement this soon! Thanks for sharing your idea.
What is the progress of TOC feature now?
Most helpful comment
@themattgabriel
Awesome! Then, I'll try to implement this soon! Thanks for sharing your idea.