Skip to main content

Scan a markdown file and create a table of content

Project description

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.

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

methodical-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

methodical-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file methodical-0.1.1.tar.gz.

File metadata

  • Download URL: methodical-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for methodical-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2ce31e4e08a87d20985fc15959248c6db4969c5617e54a8e3ad50df2001c0a86
MD5 156ada640bca0cbfcc2853dd5f2b9ca5
BLAKE2b-256 eb9cfb210cb5e859c4a44cb4c989b8769ede1a01622070b518e880b38f8e91df

See more details on using hashes here.

File details

Details for the file methodical-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: methodical-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for methodical-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c0550d9f4a1a7b450eb27c32f64d40c12134cdd3fc8dc68b10bdbdc63894c472
MD5 a85348bf93250fc73591985e3492b2e9
BLAKE2b-256 17cf9e68858dc54c4b5396bf76a34e8c5aec1fba5ce74853bf617ca3ce93f99d

See more details on using hashes here.

Supported by

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