Autogenerated Table of Contents for Github Markdown or Bear Notes
Generated by the script ;)
I love using Bear Notes for note taking of all sorts. Recently, Bear released a feature that allowed headers to be linked with x-callback-urls. And thus, I created a script to autogenerate a Table of Contents for your notes based on the headers.
NOTE: This program is only compatible with Python 3.x
$ pip3 install markdown-toc --upgrade
$ git clone https://github.com/alexander-lee/markdown-github-bear-toc.git
$ cd markdown-github-bear-toc
$ python3 setup.py install
-h
or --header-priority
is the Limiting Header Priority/Strength (whether you limit your Table of Contents to h3s or h4s)-t
or --type
is the type of anchor you want to use (Github or Bear x-callback-url)--no-write
is a flag on whether you want to disable the feature that automatically injects the ToC into your Markdown file or Bear Note-toc
or --table-of-contents-style
is the Markdown style for your Table of Contents header$ markdown-toc -h <default: 3> -t bear [--no-write] "Bear Note Title"
20703126-FA33-400A-B98E-F55F57E3EF48-47683-000143B2335758CA
$ markdown-toc -h <default: 3> -t bear [--no-write] "20703126-FA33-400A-B98E-F55F57E3EF48-47683-000143B2335758CA"
$ markdown-toc -h <default: 3> -t bear [--no-write] "Bear Note Title 1" "Bear Note Title 2"
#bear
OR tag #beet
$ markdown-toc -h <default: 3> -t bear [--no-write] "#bear" "#beet"
--no-write
flag.#tags
at the top of your note (cause I use them to categorize my notes), it will inject the ToC right after any tags.Original Note | Note with ToC |
---|---|
$ markdown-toc -h <default: 3> -t github [--no-write] README.md
$ markdown-toc -h <default: 3> -t github [--no-write] README.md Folder/README2.md