Generate a table of contents markdown file
Project description
mkdocs-toc-md
mkdocs-toc-md is an mkdocs plugin that generates a table of contents as markdown. To render as html, the toc md file must be generated before the mkdocs build
.
Sample
Usage
Generates toc markdown file.
-
Install plugin.
pip install mkdocs-toc-md
-
Add plugin conifg to mkdocs.yml.
plugins: - toc-md
-
Run
mkdocs serve
to output toc md file. -
Check docs/index.md.
Adds description.
If you use metadata (front matter), set the value with toc_md_description as a key.
---
toc_md_description: pickup target value
---
or use options pickup_description_meta
pickup_description_class
.
Options
plugins:
- toc-md:
toc_page_title: Contents
toc_page_description: Usage mkdocs-toc-md
header_level: 3
pickup_description_meta: false
pickup_description_class: false
output_path: index.md
output_log: true
ignore_page_pattern: index.md
remove_navigation_page_pattern: index.md
template_dir_path: custom_template
toc_page_title: str
h1 text in toc md.
toc_page_description: str
Renders description after h1.
header_level: int
Header level (depth) to render.
h1→1, h2→2, ...
pickup_description_meta: bool
Renders description after h2 in toc md. If you use metadata (front matter), no need set this option.
<mata name="description" content="pickup target value" />
pickup_description_class: bool
Renders description after h2 in toc md. If you use metadata (front matter), no need set this option.
# mkdocs-toc-md
<div class="toc-md-description">
pickup target value
</div>
output_path: str
Path to save rendered toc md file.
index.md → docs/index.md
output_log: bool
Output toc md contents to console.
ignore_page_pattern: str
Regular expression pattern of md filenames to be excluded from toc md files.
To prevent the table of contents page from listing itself, set the same value as the output file name (output_path).
remove_navigation_page_pattern: str
Regular expression pattern of md filenames to remove navigation items.
To hide the navigation on the table of contents page, set the same value as the output file name (output_path).
template_dir_path: str
Path of template dir.
Put toc.md.j2
in your custom template dir.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs_toc_md-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cdf45065cf1304e2107a58aa75d7a762e92976395ff13be6f25091d513dca16 |
|
MD5 | 35e0a94bf690e636e177c1921574e8e3 |
|
BLAKE2b-256 | 8d40fd11dea0ee11db9aea13da29f04a691a51fa00ef2c0bd71ed4c86f0c807d |