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
You can generate it using this bash one-liner. Assumes your markdown file is called FILE.md.
FILE.md
echo "## Contents" ; echo ; cat FILE.md | grep '^## ' | grep -v Contents | sed 's/^## //' | while read -r title ; do link=$(echo $title | tr 'A-Z ' 'a-z-') ; echo "- [$title](#$link)" ; done