Boostnote.next: Support table of contents

Created on 11 Jan 2020  路  4Comments  路  Source: BoostIO/BoostNote.next

Current behavior

Adding the lines below in the editor does nothing.

<!-- toc -->

<!-- tocstop -->

The option to add TOC is not available in the menu bar.

Expected behavior

Ctrl + Shift + T changes the view. It no longer generates table of content like it did with old boostnote.

Environment

  • Version : 0.1.3
  • OS Version and name : Windows 10

feature request

Most helpful comment

@themattgabriel
Awesome! Then, I'll try to implement this soon! Thanks for sharing your idea.

All 4 comments

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.

ToC UI

Provide ToC UI so you can navigate a note without generating TOC.

ToC Shortcode

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

isy picture isy  路  3Comments

chloechen8 picture chloechen8  路  5Comments

Username77177 picture Username77177  路  4Comments

Rokt33r picture Rokt33r  路  6Comments

marilari88 picture marilari88  路  3Comments