LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mado

Fast Markdown linter for CommonMark and GitHub Flavored Markdown

TLDR

Check the current directory
$ mado check
copy
Check specific files or directories
$ mado check [docs/] [README.md]
copy
Exclude paths by glob (comma-separated)
$ mado check --exclude "[**/node_modules/**]" [docs/]
copy
Use a config file
$ mado --config [path/to/mado.toml] check [docs/]
copy
Print violations like mdl
$ mado check --output-format [mdl] [docs/]
copy
Shell completion
$ mado generate-shell-completion [bash]
copy

SYNOPSIS

mado [--config file] check [options] [paths...]mado generate-shell-completion shell

DESCRIPTION

mado is a Rust linter for CommonMark and GitHub Flavored Markdown. It checks the markdownlint rule set (MD001 through MD047, with gaps) and exits 0 when every file passes, printing All checks passed! unless --quiet is set. Any violation exits non-zero after a count of errors.With a terminal on stdin it lints the given paths in parallel. With a pipe it lints that text instead.

PARAMETERS

--config file

TOML file used instead of the discovered mado.toml. Place it before the subcommand.
check [paths...]
Lint Markdown files. Directories are walked. Default path is .. Non-terminal stdin is linted as one document and the path arguments are ignored.
--output-format format
concise (default), mdl, or markdownlint. Overrides output-format in the config file.
--quiet
Print violations only. Suppresses the success line. ORed with quiet in the config file.
--exclude globs
Comma-separated globs to skip. Replaces the exclude list from the config file for this run.
generate-shell-completion shell
Print a completion script. shell is bash, elvish, fish, powershell, or zsh.
-h, --help
Help. mado with no subcommand does the same.
-V, --version
Print the version.

CONFIGURATION

mado.toml or .mado.toml in the working directory is loaded first. If neither exists, mado reads the user config: ~/.config/mado/mado.toml on Linux and macOS, ~\AppData\Roaming\mado\mado.toml on Windows.

$ [lint]
output-format = "concise"
respect-gitignore = "repository-only"
exclude = ["**/node_modules/**"]

[lint.md013]
line-length = 80
code-blocks = false
tables = false
copy
respect-gitignore is never, repository-only (default: only inside a Git, worktree, submodule, or jj tree), or always (also when the tree has no Git metadata, such as a source archive). respect-ignore controls .ignore files. The global Git ignore file and .git/info/exclude are never read.Rule options live under [lint.MD###] (heading style, line length, allowed HTML elements, and so on). A JSON Schema for the file is shipped in the repository.

INSTALL

sudo pacman -S mado
copy
sudo apk add mado
copy
brew install mado
copy
nix profile install nixpkgs#mado
copy

CAVEATS

This is not the Node markdownlint CLI and it does not autofix. The upstream README marks MD003, MD007, MD020, MD027, and MD032 as unstable, and some rule options are unsupported. --exclude on the command line replaces the configured exclude list rather than adding to it. A piped run does not lint the paths you also passed.

SEE ALSO

markdownlint(1), vale(1), prettier(1), glow(1)

RESOURCES

Copied to clipboard
Kai