Skip to main content

Colorful CLI for slicing Markdown sections via dotted paths

Project description

markat

mkat is a tiny CLI that prints a nested Markdown subsection using a dotted path syntax. Each dotted segment refers to the n-th heading for a particular depth (defaulting to ##, ###, ####, ...):

# syntax
2.3.2  -> second `##`, third `###` inside it, second `####` inside that

Features

  • Dotted selection syntax (2.3.2 = 2nd ##, 3rd ###, 2nd ####).
  • Colorized output that highlights the breadcrumb path plus the raw section.
  • --plain/-p flag for piping the exact Markdown without headers/colors.
  • --color/--no-color switches to override auto-detection when needed.
  • --base-level flag to align the first index with your preferred heading depth.

Usage

uv sync
uv run mkat example.md 2.1.2        # colorful header + section text
uv run mkat example.md 2.1.2 -p     # plain Markdown only
uv run mkat docs/spec.md 1 --color  # force-enable color when piping

Ship a Markdown file like example.md (included) to experiment with the dotted paths. Add --base-level 1 if your top-level headings start with # instead of ##.

Testing

python -m unittest discover

The test suite covers path parsing, section selection, and the CLI presentation helpers.

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

markat-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

markat-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file markat-0.1.0.tar.gz.

File metadata

  • Download URL: markat-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for markat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f7e4a26d4e16930c61dbf9f6aa736a17d5ef6886fdbe1624a95a05fe320ab38f
MD5 58dba61d07ea40085b3bc350516c619f
BLAKE2b-256 0ffb3c5566c867f6fc8b5c748c15a8f68ae7485e97c09069fa4c101eff87bb3a

See more details on using hashes here.

File details

Details for the file markat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: markat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for markat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c2e4c26748f484682808f6e8a01f303b6ec2c69cfde87a8d108ba87ce7d68a
MD5 048dca183bfa1bea6995374880cbbef3
BLAKE2b-256 a904f52340ce52c396c396af99049e8eabb70af6f6c6794c49a35f6aef836a99

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