Skip to main content

Add table of contents to markdown files

Project description

.. 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

Project details


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.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page