百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

mado

> 开发工具
开源

一个使用 Rust 编写的快速 Markdown 校验器。

378 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个使用 Rust 编写的快速 Markdown 校验器。

Mado

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

Usage

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

Performance

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

mermaid
---
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)

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

Nix (macOS and Linux)

bash
nix profile install github:akiomik/mado

Arch Linux (Linux)

bash
pacman -S mado

Scoop (Windows)

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

WinGet (Windows)

bash
# 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.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.

Ignore files

respect-ignore decides whether .ignore files exclude what they list. respect-gitignore decides when .gitignore files do:

value .gitignore files are read
"never" not at all
"repository-only" (default) inside a Git repository, as Git does
"always" whether or not the tree carries Git metadata

A repository here is a .git directory, the .git file a worktree or a submodule carries, or a .jj directory, which the ignore crate stops at as well.

"always" suits a tree that arrives without its Git metadata — a source archive, or a Docker context copied without .git. It stops mado looking for a repository at all, for every tree rather than only those without one, which is what the ignore crate offers and what rg --no-require-git does. So .gitignore files apply from every parent directory, above a clone's own repository root included, and a repository below the path being linted does not bound the search.

The global Git ignore file and .git/info/exclude are never read. Neither travels with the tree being linted, so reading them would have one source lint differently on another machine.

GitHub Actions

Mado is compatible with GitHub Actions.

yaml
# 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'

The action downloads the mado release it was published with. Setting the version input names a different release to run; a pin from before the input was added ignores it.

Development

just is required.

Running Tests

bash
just test

Linting Code

bash
just lint

Acceptance Testing

Compares what mado and mdl report for markdownlint's own rule fixtures. This needs mdl, cargo and git on PATH.

bash
# Download the fixtures and set aside the ones written against their own style
./scripts/acceptance/setup.sh

# Write each tool's findings to tmp/mdl.txt and tmp/mado.txt
./scripts/acceptance/test.sh

diff tmp/mdl.txt tmp/mado.txt

That diff is not expected to be empty. Some of it is the two tools disagreeing and some of it is the two configurations differing, which is being worked out in #401.

Benchmarking

This needs hyperfine, mdl, node, npm, cargo and git on PATH.

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

# Install the markdownlint commands the comparison runs against
npm --prefix scripts/benchmarks ci

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

Profiling

First, install flamegraph:

bash
cargo install flamegraph

Then run:

bash
just flamegraph

Fuzz Testing

First, install cargo-fuzz:

bash
cargo install cargo-fuzz

Then run:

bash
just fuzz

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustgithub-actionslintermarkdownrust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具