Package: mkdocs-toc-md
mkdocs-toc-mdmkdocs-toc-mdis a plugin for mkdocs that generates a table of contents in markdown format. To render the table of contents as HTML, the markdown file must be generated before runningmkdocs build.SampleFileSiteUsageGenerates toc markdown file.Install plugin.pip install mkdocs-toc-mdAdd plugin config to mkdocs.yml.plugins:
  - toc-mdRunmkdocs serveto output the 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 optionspickup_description_metapickup_description_class.OptionsMinimumplugins:
  - toc-md:Fullplugins:
  - 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: false
      ignore_page_pattern: index.*.md$
      remove_navigation_page_pattern: index.*.md$
      template_dir_path: custom_template
      integrate_mkdocs_static_i18n: true
      languages:
        en:
          toc_page_title: Contents
          toc_page_description: Usage mkdocs-toc-md
        ja:
          toc_page_title: 目次
          toc_page_description: mkdocs-toc-mdプラグインの使い方
      shift_header: after_h1_of_index
      extend_module: true
      output_comment: htmltoc_page_title: strh1 text in the table of contents markdown file.default: Contentstoc_page_description: strThe description will be rendered below the h1 tag in the table of contents.default: Noneheader_level: intHeader level (depth) to render.h1→1, h2→2, ...default: 3pickup_description_meta: boolThe plugin renders the description after the h2 header in the table of contents markdown file. If you use metadata (front matter), there is no need to set this option.<mataname="description"content="pickup target value"/>default: Falsepickup_description_class: boolThe plugin renders the description after the h2 header in the table of contents markdown file. If you use metadata (front matter), there is no need to set this option.# mkdocs-toc-md<div class="toc-md-description">
pickup target value
</div>default: Falseoutput_path: strPath to save rendered toc md file.index.md → docs/index.mddefault: index.mdoutput_log: boolOutput contents of markdown file to console.default: Falseignore_page_pattern: strRegular expression pattern of markdown file names to be excluded from toc markdown file.To prevent the table of contents page from listing itself, set the same value as the output file name (output_path).default: ''remove_navigation_page_pattern: strRegular expression pattern of markdown file names 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).default: ''template_dir_path: strPath of template dir.
Puttoc.md.j2in your custom template dir.default: ''beautiful_soup_parser: strParser used in BeautifulSoup. Default is html.parser.If using html5lib or lxml, you need to install additional dependencies.default: html.parserintegrate_mkdocs_static_i18n: boolWithmkdocs-static-i18ndefault: Falselanguages: dictUse with integrate_mkdocs_static_i18n option.
Set toc_page_title, toc_page_description for each language.languages:
    en:
        toc_page_title: Contents
        toc_page_description: Usage mkdocs-toc-md
    ja:
        toc_page_title: 目次
        toc_page_description: mkdocs-toc-mdプラグインの使い方default: dict()shift_header: str (after_index, after_h1_of_index, none)after_indexShifts the header level(+1) except for the index file in the directory.after_h1_of_indexShifts the header level(+1) after h1 in index file and except for the index file in the directory.none(default)extend_module: boolSome processes can be extended by placing the toc_extend_module.py file in the docs folder.├─ docs
│  ├─ mkdocs.yml
│  ├─ toc_extend_module.pySample/toc_extend_module.pyfind_src_elements-> list[bs4.element.Tag]argsbs_page_soup: bs4.BeautifulSouppage: mkdocs.structure.pages.Pagetoc_config: mkdocs_toc_md.objects.TocConfigcreate_toc_items-> list[mkdocs_toc_md.objects.TocItem]argspage: mkdocs.structure.pages.Pagepage_description: strsrc_elements: list[bs4.element.Tag]toc_config: mkdocs_toc_md.objects.TocConfigon_create_toc_itemargstoc_item: mkdocs_toc_md.objects.TocItemsrc_element: bs4.element.Tagpage: mkdocs.structure.pages.Pagetoc_config: mkdocs_toc_md.objects.TocConfigon_before_outputargsnav: mkdocs.structure.nav.Navigationtoc_items: list[mkdocs_toc_md.objects.TocItem]toc_config: mkdocs_toc_md.objects.TocConfigoutput_comment: str (html, metadata, none)html(default)<!-- ====================== TOC ====================== --><!-- Generated by mkdocs-toc-md plugin --><!-- ================================================= -->metadata---
toc_output_comment: Generated by mkdocs-toc-md plugin
---none