Mado: Fast Markdown linter written in Rust

原始链接: https://github.com/akiomik/mado

Hacker Newsnew | past | comments | ask | show | jobs | submitloginMado: Fast Markdown linter written in Rust (github.com/akiomik)10 points by nateb2022 4 hours ago | hide | past | favorite | 2 comments help nikolay 2 hours ago | prev [–] How is it any better than rumdl [0]?[0]: https://github.com/rvben/rumdlreplynateb2022 20 minutes ago | parent [–] Mado is older (~April 2024) vs rumdl (~March 2025). It's also faster, per rumdl's own benchmark graph.Mado is purely a linter; rumdl is also a partial formatter, and offers a LSP.Panache has a well written and broader comparison between these, and other tools here: https://panache.bz/guide/comparison.htmlreply Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact Search:
相关文章

原文

CI codecov

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

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

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]
Loading

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

Homebrew (macOS and Linux)

brew tap akiomik/mado https://github.com/akiomik/mado.git
brew install mado
nix profile install github:akiomik/mado
scoop install https://raw.githubusercontent.com/akiomik/mado/refs/heads/main/pkg/scoop/mado.json
# 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

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

Mado supports most markdownlint rules.

  • ✅ Stable support
  • 🔨 Unstable support
  • ⚠️ Unsupported option(s)
  • ❌ Not supported
Rule Support Note
MD001
MD002
MD003 🔨
MD004
MD005
MD006
MD007 🔨
MD009
MD010
MD012
MD013
MD014
MD018
MD019
MD020 🔨
MD021
MD022
MD023
MD024
MD025
MD026
MD027 🔨
MD028
MD029
MD030
MD031
MD032 🔨
MD033
MD034
MD035
MD036
MD037
MD038
MD039
MD040
MD041
MD046
MD047

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.

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'

just is required.

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

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

First, install flamegraph:

Then run:

First, install cargo-fuzz:

Then run:

联系我们 contact @ memedata.com