mdformat

Crates.iomdformat
lib.rsmdformat
version0.1.6
created_at2025-05-18 14:33:55.161055+00
updated_at2026-01-04 05:53:51.170481+00
descriptionA formatter for markdown source code.
homepage
repositoryhttps://github.com/huleiak47/mdformat
max_upload_size
id1678674
size3,240,714
James Hu (huleiak47)

documentation

README

Markdown Formatter

A command-line tool for formatting markdown text with consistent empty lines and spacing.

Features

  • Add spaces between CJK and Latin/ASCII characters
  • Add blank lines after header/table/code block
  • Add blank lines before table/code block
  • Remove extra blank lines
  • Align table columns
  • Format ordered and unordered lists

Installation

From Source

  1. Ensure Rust 1.85+ is installed
  2. Build release binary:
cd mdformat
cargo build --release
  1. The binary will be in target/release/mdformat

Usage

Basic formatting:

mdformat input.md -o formatted.md

Pipe from stdin/stdout:

cat input.md | mdformat > formatted.md

Command Line Options

Formats Markdown code with consistent empty lines and spacing

Usage: mdformat [OPTIONS] [INPUT]

Arguments:
  [INPUT]  Input file (default: stdin)

Options:
  -o, --output <OUTPUT>  Output file (default: stdout)
  -i, --indent <INDENT>  Number of spaces for indentation [default: 4]
  -h, --help             Print help
  -V, --version          Print version

License

MIT Licensed

Commit count: 3

cargo fmt