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/-pflag for piping the exact Markdown without headers/colors.--color/--no-colorswitches to override auto-detection when needed.--base-levelflag 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7e4a26d4e16930c61dbf9f6aa736a17d5ef6886fdbe1624a95a05fe320ab38f
|
|
| MD5 |
58dba61d07ea40085b3bc350516c619f
|
|
| BLAKE2b-256 |
0ffb3c5566c867f6fc8b5c748c15a8f68ae7485e97c09069fa4c101eff87bb3a
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2c2e4c26748f484682808f6e8a01f303b6ec2c69cfde87a8d108ba87ce7d68a
|
|
| MD5 |
048dca183bfa1bea6995374880cbbef3
|
|
| BLAKE2b-256 |
a904f52340ce52c396c396af99049e8eabb70af6f6c6794c49a35f6aef836a99
|