Skip to content

Markdown TOC and Mkdocs

There is a small issue with the tables-of-contents generated to confirm with MD007 in that the lint/standard is 2 spaces, while Mkdocs required 4 spaces to work.

Thankfully a kind soul has developed a plugin to stop this being a pain when you want your TOC to automatically update on save, but not get corrupted.

mdx_truly_sane_lists is what you need. Simply install it as part of your build environment and append it to the mkdocs.yaml markdown_extensions section:

markdown_extensions:
  - ...
  - mdx_truly_sane_lists

Comments