Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

methodical

A simple command-line tool that scans Markdown files for headlines and assembles them into a clean, nested table of contents.

Features

📑 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)

Installation

Local Installation

git clone https://github.com/lalinguette/methodical.git
cd methodical
pip install -e .

Usage

methodical PATH/TO/FILE.md

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

Contributing

Git Hooks

This project uses pre-commit to enforce style and run tests:

pip install pre-commit
pre-commit install
pre-commit install --hook-type pre-push

Now formatting and tests will run automatically before you commit or push.

License

This project is licensed under the MIT License.

About

A simple tool that scans markdown pages for headlines and assembles them in a table of contents

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages