- 1 methodical
- 1.1 Features
- 1.2 Installation
- 1.2.1 Local Installation
- 1.3 Usage
- 1.4 Contributing
- 1.4.1 Git Hooks
- 1.5 License
A simple command-line tool that scans Markdown files for headlines and assembles them into a clean, nested table of contents.
📑 Parse Markdown files and detect headings (#, ##, ###, …)
🗂 Generate a structured Table of Contents
🔗 Insert anchor links to headings
⚡ Fast and lightweight — no external dependencies besides Python
🛠 Easy to integrate into your workflow (e.g., pre-commit hook)
git clone https://github.com/lalinguette/methodical.git
cd methodical
pip install -e .methodical PATH/TO/FILE.mdThis will add a ToC to the top of your file and print the Markdown ToC to stdout
Example
- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [Command line](#command-line)
- [Python API](#python-api)You can redirect the output into a file:
methodical example_files/example.md > TOC.mdThis project uses pre-commit to enforce style and run tests:
pip install pre-commit
pre-commit install
pre-commit install --hook-type pre-pushNow formatting and tests will run automatically before you commit or push.
This project is licensed under the MIT License.