Skip to main content
.. raw:: html

<!-- starttoc -->

Table of contents
=================

- `mdTOC <#mdtoc>`__

- `Installation <#installation>`__
- `Usage <#usage>`__

- `Generate TOC <#generate-toc>`__
- `Generate and update file <#generate-and-update-file>`__

- `Via python <#via-python>`__

- `Optional arguments <#optional-arguments>`__

.. raw:: html

<!-- endtoc -->

mdTOC
=====

Create Table of contents for markdown files

Installation
------------

.. code:: shell

pip install pymdtoc

Usage
-----

Generate TOC
~~~~~~~~~~~~

.. code:: shell

mdtoc generate filename.md

Generate and update file
~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: shell

mdtoc inplace filname.md

Via python
----------

.. code:: python

from pymdtoc import TOC
toc = TOC(file="filename.md")
print(toc.toc)
print(toc.content)

Optional arguments
~~~~~~~~~~~~~~~~~~

- ``toc_heading`` - Table of contents heading (str)
- ``anchor_function`` - Ability to provide custom anchor tag generator

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymdtoc-1.0.1.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file pymdtoc-1.0.1.tar.gz.

File metadata

  • Download URL: pymdtoc-1.0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymdtoc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d8344437caad379e2acf825eb0bb6eb1497bd32d3977b7fb79d3754bee25c6f6
MD5 95e481924e960c14b8243395a12130d9
BLAKE2b-256 d2081bde2407e78a678adfddcfaee5812863ad61fb8c16c452ae276d1acf806a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 file

1.0

1 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