Skip to content

An MkDocs plugin that allows users to add additional content to the ToC sidebar using the Material theme

License

Notifications You must be signed in to change notification settings

zachhannum/mkdocs-toc-sidebar-plugin

Repository files navigation

mkdocs-toc-sidebar-plugin

An MkDocs plugin that allows users to add additional content to the ToC sidebar using the Material theme.

demo image

Pre-requisites

Currently this plugin will only work with the Table of Contents sidebars in the Material theme for MkDocs.

Setup

Install the plugin using pip:

pip install mkdocs-toc-sidebar-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - toc-sidebar

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the MkDocs documentation.

Usage

To add a toc sidebar to one of your markdown pages, simply add a div anywhere in the markdown source like so:

<div markdown=1 class="sidebar">
# Toc Sidebar

It's filled with information specific to this page.

It's locked to the screen just like the ToC!
</div>

See Also

More information about templates here.

More information about blocks here.

About

An MkDocs plugin that allows users to add additional content to the ToC sidebar using the Material theme

Resources

License

Stars

Watchers

Forks

Packages

No packages published