Mado

July 25, 2025 ยท View on GitHub

CI codecov

A fast Markdown linter written in Rust. Compatible with CommonMark and GitHub Flavored Markdown (GFM).

Usage

mado check .
mado check path/to/*.md

Performance

Approx. 49-60x faster than existing linters (e.g. markdownlint).

---
config:
    xyChart:
        height: 200
        titleFontSize: 14
        chartOrientation: horizontal
        xAxis:
            labelFontSize: 12
            titleFontSize: 14
        yAxis:
            labelFontSize: 12
            titleFontSize: 14
---
xychart-beta
    title "Linting ~1,500 Markdown files (Lower is faster)"
    x-axis ["mado (rust)", "markdownlint-cli (node.js)", "markdownlint (ruby)", "markdownlint-cli2 (node.js)"]
    y-axis "Time (seconds)" 0 --> 10
    bar [0.129, 6.381, 6.609, 7.817]

This benchmark was conducted on a MacBook Pro (2021, M1 Max) using hyperfine with GitLab documentation as the dataset.

Installation

Homebrew (macOS and Linux)

brew tap akiomik/mado https://github.com/akiomik/mado.git
brew install mado

Nix (macOS and Linux)

nix profile install github:akiomik/mado

Arch Linux (Linux)

pacman -S mado

Scoop (Windows)

scoop install https://raw.githubusercontent.com/akiomik/mado/refs/heads/main/pkg/scoop/mado.json

WinGet (Windows)

# For security reasons, installing from local manifest files requires that this feature be enabled by an administrator.
# For more details, see https://learn.microsoft.com/en-us/windows/package-manager/winget/install#local-install
winget settings --enable LocalManifestFiles

curl.exe -o mado.yml https://raw.githubusercontent.com/akiomik/mado/refs/heads/main/pkg/winget/mado.yml
winget install -m mado.yml

Manually

Pre-built binaries are available for download from the release page.

Supported Rules

Mado supports most markdownlint rules.

  • :white_check_mark: Stable support
  • :hammer: Unstable support
  • :warning: Unsupported option(s)
  • :x: Not supported
RuleSupportNote
MD001:white_check_mark:
MD002:white_check_mark:
MD003:hammer:
MD004:white_check_mark:
MD005:white_check_mark:
MD006:white_check_mark:
MD007:hammer:
MD009:white_check_mark:
MD010:white_check_mark:
MD012:white_check_mark:
MD013:white_check_mark:
MD014:white_check_mark:
MD018:white_check_mark:
MD019:white_check_mark:
MD020:hammer:
MD021:white_check_mark:
MD022:white_check_mark:
MD023:white_check_mark:
MD024:white_check_mark:
MD025:white_check_mark:
MD026:white_check_mark:
MD027:hammer:
MD028:white_check_mark:
MD029:white_check_mark:
MD030:white_check_mark:
MD031:white_check_mark:
MD032:hammer:
MD033:white_check_mark:
MD034:white_check_mark:
MD035:white_check_mark:
MD036:white_check_mark:
MD037:white_check_mark:
MD038:white_check_mark:
MD039:white_check_mark:
MD040:white_check_mark:
MD041:white_check_mark:
MD046:white_check_mark:
MD047:white_check_mark:

Configuration

Mado can be configured via mado.toml or .mado.toml file in the current directory. You can also use global configuration files located in:

  • Linux: ~/.config/mado/mado.toml
  • macOS: ~/.config/mado/mado.toml
  • Windows: ~\AppData\Roaming\mado\mado.toml

For more details, see the example mado.toml and the JSON Schema for mado.toml.

GitHub Actions

Mado is compatible with GitHub Actions.

# Basic usage (runs `mado check .`)
- uses: akiomik/mado@v0.3.0

# Custom usage (runs `mado` with specified arguments)
- uses: akiomik/mado@v0.3.0
  with:
    args: '--config path/to/mado.toml check path/to/*.md'

Development

just is required.

Running Tests

just test

Linting Code

just lint

Benchmarking

# Download Markdown dataset
./scripts/benchmarks/setup.sh

# Benchmark mado, mdl and markdownlint-cli using hyperfine
./scripts/benchmarks/comparison.sh

Profiling

First, install flamegraph:

cargo install flamegraph

Then run:

just flamegraph

Fuzz Testing

First, install cargo-fuzz:

cargo install cargo-fuzz

Then run:

just fuzz