I started to use markdown to take notes.
I use marked to view my markdown notes and its beautiful.
But as my notes get longer I find it diff
In Visual Studio Code (VSCode) you can use the extension Markdown All in One.
Once installed, follow the steps below:
EDIT: nowadays I use DocToc to generate the table of contents, see my other answer for details.