Skip to main content

MD TOC

A tool to create tables of contents from markdown files, in markdown format.

Introduction

md-toc-creator is a tool written in python that adheres to the old Unix philosophy of doing one thing and one thing well. It reads a given markdown file (or standard input) and produces a table of contents. The TOC can be generated with or without links, in markdown format, based on any headings that may exist in the document, as well as their level.

Usage Information

    ./mdtoc.py -h
usage: MD TOC [-h] [-m {1,2,3,4,5,6}] [-M {0,1,2,3,4,5,6}] [-n] [-o OUTPUT]
              [-s SEPARATOR] [-w WHITESPACE] [-x LEVEL]
              [input]

Generate a table of contents for a markdown document

positional arguments:
  input                 The markdown file to read.

optional arguments:
  -h, --help            show this help message and exit
  -m {1,2,3,4,5,6}, --min-indent {1,2,3,4,5,6}
                        Specify the minimum level of heading for which the
                        list items will be indented. Headings at or below this
                        level will not be indented and the rest of the heading
                        levels will be adjusted accordingly. The default is 1.
  -M {0,1,2,3,4,5,6}, --max-indent {0,1,2,3,4,5,6}
                        Specify the maximum level of heading for which the
                        list items will be indented. Headings above this level
                        will not be indented any further; Thus, specifying 0
                        flattens the list. The default is 6.
  -n, --no-links        Do not link the sections of the document to their list
                        items in the table of contents.
  -o OUTPUT, --output OUTPUT
                        The markdown file to write the table of contents to.
                        The default is standard output.
  -s SEPARATOR, --separator SEPARATOR
                        Specifies a string to be used as the separator between
                        the '*' character and the succeeding list item
                        (default: ' ').
  -w WHITESPACE, --whitespace WHITESPACE
                        Specify the characters used as whitespace before each
                        item. This is repeated or omitted depending on the
                        indentation level of each item. (default: ' ')
  -x LEVEL, --exclude LEVEL
                        Specify specific levels of heading to exclude from the
                        table of contents. This option can be repeated to
                        exclude multiple levels.

Submit any bugs to https://github.com/mcb2003/md-toc-creater/issues/new

Metadata

Release files for md-toc-creator 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for md-toc-creator 1.4.1
File Interpreter ABI Platform
md_toc_creator-1.4.1-py3-none-any.whl Python 3 none any Details

Release files / md_toc_creator-1.4.1-py3-none-any.whl

Download URL md_toc_creator-1.4.1-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4fb215c7e05087f9d440df99d0f6795a6075740cade77664135aace07e503ca
BLAKE2b-256 checksum
How to use checksums
92d5a4ee7ce63744ca4db9bed282ad639e56d2cf04a5ef8a09a59796069c2e6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

1.4.1 This release

1 release file

1.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page