I believe it would be nice to have this feature :)
It sounds great. Where do you think we should put the TOC? Do you have any example?
Not the best implementation i think but this is workable for markdown: https://atom.io/packages/markdown-toc
With auto update:

Just my two cents, I'd like to see TOC after the first heading in the preview mode/pane. It would also be nice to have the feature to disable automatic generation by Preferences.
# The first heading
(automatically generated TOC here: since the first heading [if exists] also becomes the note title)
## h2
## h2
@[toc] tag.This feature was even added last year, but was removed because of a bug.
Merged TOC feature: github.com/BoostIO/Boostnote/pull/310
Bug: github.com/medfreeman/markdown-it-toc-and-anchor
Referenced in a relevant issue: Table of Contents case sensitivity
@boostio funded this issue with $40. Visit this issue on Issuehunt
@mbarczak has started working. Visit this issue on Issuehunt
@mbarczak has submitted output. Visit this issue on Issuehunt
Here is another very practical solution
(like Typora - https://typora.io)

@kazup01 has rewarded. Visit this issue on Issuehunt
Most helpful comment
Not the best implementation i think but this is workable for markdown: https://atom.io/packages/markdown-toc