MCPcopy Index your code
hub / github.com/akiomik/mado

github.com/akiomik/mado @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
640 symbols 1,390 edges 86 files 1 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Mado

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

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

Extension points exported contracts — how you extend this code

RuleLike (Interface)
(no doc) [38 implementers]
src/rule.rs

Core symbols most depended-on inside this repo

to_violation
called by 71
src/rule.rs
iter
called by 37
src/collection.rs
check
called by 14
src/rule/md032.rs
check
called by 13
src/rule/md027.rs
len
called by 12
src/collection.rs
contains
called by 12
src/collection.rs
check
called by 11
src/rule/md003.rs
check
called by 11
src/rule/md004.rs

Shape

Function 326
Method 228
Class 74
Enum 11
Interface 1

Languages

Rust100%
Ruby1%

Modules by API surface

src/collection.rs21 symbols
src/rule/md032.rs18 symbols
src/rule/md004.rs18 symbols
src/rule/md027.rs17 symbols
src/rule/md003.rs17 symbols
src/rule/md030.rs16 symbols
src/rule/md013.rs16 symbols
src/rule/md036.rs15 symbols
src/rule/md033.rs15 symbols
src/rule/md046.rs13 symbols
src/rule/md029.rs13 symbols
src/rule/md026.rs13 symbols

For agents

$ claude mcp add mado \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact