Skip to main content

mdformat-tight-lists

Build Status PyPI version

An mdformat plugin that formats Markdown lists to be tight (no empty lines between list items) following mdformat-style rules.

Installation

pip install mdformat-tight-lists

Or with pipx for command-line usage:

pipx install mdformat
pipx inject mdformat mdformat-tight-lists

Usage

After installation, mdformat will automatically use this plugin when formatting Markdown files:

mdformat your-file.md

Features

  • Smart List Formatting: Automatically creates tight lists by removing unnecessary empty lines
  • List Type Detection: Different top-level markers (-, *, +) are treated as separate lists
  • Nested List Handling: Properly handles transitions between ordered and unordered lists
  • Multi-Paragraph Support: Preserves loose formatting when list items contain multiple paragraphs

Examples

Input:

- Item 1

- Item 2

- Item 3

Output:

- Item 1
- Item 2
- Item 3

Multi-paragraph items (loose list preserved):

- First item with multiple paragraphs

  Second paragraph of first item

- Second item

Development

Setup

# Clone the repository
git clone https://github.com/jdmonaco/mdformat-tight-lists.git
cd mdformat-tight-lists

# Install development environment with uv
uv sync

Running Tests

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=mdformat_tight_lists

# Run tests verbosely
uv run pytest -v

Adding Tests

To add new test cases, edit tests/fixtures.md following the existing format:

  • Test title
  • Input markdown (between dots)
  • Expected output (between dots)

License

MIT - see LICENSE file for details.

Metadata

Release files for mdformat_tight_lists 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdformat_tight_lists 0.1.1
File Size Uploaded
mdformat_tight_lists-0.1.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mdformat_tight_lists 0.1.1
File Interpreter ABI Platform
mdformat_tight_lists-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / mdformat_tight_lists-0.1.1.tar.gz

Download URL mdformat_tight_lists-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6efa654ddf7056a860233ee30b6c6f667debb1a8c381148b7fc3110682c4087f
BLAKE2b-256 checksum
How to use checksums
8b450a2844db22026bfbd8d3b99546ef4633405d8bcf98ee4b83be679d57c871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.4

Release files / mdformat_tight_lists-0.1.1-py3-none-any.whl

Download URL mdformat_tight_lists-0.1.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec3f819949352b2659d7658fd6567cd19de5f3c58b18b13337cad9ba9e93d49d
BLAKE2b-256 checksum
How to use checksums
46fd9927fd12ba91c19b8025ff3327656dd9e904af32df0d9db5b36b11282f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page