fsnotes icon indicating copy to clipboard operation
fsnotes copied to clipboard

Table of contents

Open danielparton opened this issue 5 years ago • 2 comments

Would it be possible to add a table of contents feature? The user would type something in the note such as [toc] or {{TOC}}, and the renderer would generate a table of contents with clickable anchor links that lead to specific sections.

For example, in MacDown:

image

I would find this feature extremely useful for longer notes.

I'm personally interested in this only for macOS (since I use Android), but it would probably make sense for iOS too.

danielparton avatar Jun 03 '20 02:06 danielparton

this would most likely rely on upstream https://github.com/commonmark/cmark/issues/78

but it's possible to use macOS to do this...

you could create a Service using something like https://github.com/jonschlinkert/markdown-toc and then setup a right click menu or hot key to generate the TOC from selected text and append and replace that text. and it would work in any app.

gingerbeardman avatar Jun 03 '20 09:06 gingerbeardman

Thanks @gingerbeardman - interesting this is such a long-standing issue. I guess we'll have to hope that commonmark will eventually settle on a solution. Otherwise perhaps this could be implemented as some kind of post-rendering step in fsnotes. In the mean time there is the workaround you suggest.

danielparton avatar Jun 03 '20 13:06 danielparton

Release available for download here https://github.com/glushchenko/fsnotes/releases/tag/6.0.0

I also ask you to vote on Prouct Hunt and Reddit, it will help in spreading:

https://www.producthunt.com/posts/fsnotes-6 https://www.reddit.com/r/macapps/comments/yh8156/fsnotes_v6_pro_notes_manager_for_macos/

Thanks!

glushchenko avatar Oct 30 '22 08:10 glushchenko