Mado: Fast Markdown linter written in Rust
Summary
Mado is a fast Markdown linter written in Rust, compatible with CommonMark and GFM, claiming 49-60x speed improvement over existing linters like markdownlint.
View Cached Full Text
Cached at: 05/17/26, 12:47 PM
akiomik/mado
Source: https://github.com/akiomik/mado
Mado
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
| Rule | Support | Note |
|---|---|---|
| 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.tomlmacOS:~/.config/mado/mado.tomlWindows:~\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/[email protected]
# Custom usage (runs `mado` with specified arguments)
- uses: akiomik/[email protected]
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
Similar Articles
Satteri: A Markdown pipeline forged in Rust for the JavaScript world
Satteri is a Markdown processing pipeline that combines a fast Rust engine with flexible JavaScript plugins, available as WASM for in-browser use.
@tolgaogzz: me and my best codex ported eslint-plugin-svelte to rust it runs ~330x faster, passing all fixtures for all the rules t…
A developer ported eslint-plugin-svelte to Rust with the help of Codex, achieving ~330x speed improvement while passing all test fixtures.
@charliermarsh: https://x.com/charliermarsh/status/2057953314419990670
Ruff is an extremely fast Python linter and code formatter written in Rust, aiming to replace multiple existing tools like Flake8, Black, and isort.
Optimizing a single Rust Clippy lint by 3133X
The article explains how the `clippy::nonstandard_macro_braces` lint in Rust was optimized by 3133X, focusing on improving performance by addressing inefficiencies in handling macro expansions during compilation.
Gtk+Adwaita Markdown Editor in ~600 lines
A compact GTK+Adwaita split-view Markdown editor implementation in about 600 lines, using a GTK WebView and CDN-loaded marked.js and KaTeX. It serves as a prototype inspired by Apostrophe to demonstrate how easy building such apps has become.