markdownlint1
Markdown lint tool
Usage
mdl [options]
[{FILE.md | DIR ...}]
Overview
markdownlint checks an individual markdown file, or a directory of markdown files against a set of rules for syntax consistency. In its report back to the CLI, the Ruby based implementation reports the line(s) with an issue identified and how to improve it.
Options
-
-c, --config FILE -
The configuration file to use
-
-g, --git-recurse -
Only process files known to git when given a directory
- -i, --[no]-ignore-front-matter
-
Ignore YAML front matter
-
-j, --json -
JSON output
-
-l, --list-rules -
Don't process any files, just list enabled rules
-
-r, --rules RULE1,RULE2 -
Only process these rules
-
-u, --rulesets RULESET1,RULESET2 -
Specify additional ruleset files to load
-
-S, --sarif -
SARIF output
-a, --[no]show-aliases
|
Show rule aliases instead of rule ID when viewing rules |
|---|---|
-w, --[no]warnings
|
Show kramdown warnings |
-
-d, --skip-default-ruleset -
Don't load the default markdownlint ruleset
-
-s, --style STYLE -
Load the given style
-
-t, --tags TAG1,TAG2 -
Only process rules with these tags
- -v, --[no-]verbose
-
Increase verbosity
-
-h, --help -
Show this message
-
-V, --version -
Show version
Examples
List the objectives of rules MD012, MD022, MD031 and MD032:
-
mdl -r MD012,MD022,MD031,MD032 -l
Scrutinize file example.md only by rules MD012, MD022, MD031 and MD032:
-
mdl -r MD012,MD022,MD031,MD032 ./example.md
Scrutinize file example.md by all rules available except MD033 and MD034:
-
mdl -r ~MD033,~MD034 ./example.md
List all rules associated to the tag indentation:
-
mdl -t indentation -l
Scrutinize file example.md by all rules without tag indentation:
-
mdl -t ~indentation ./example.md
By default, markdownlint reports sort the issues by their rule. With GNU coreutils, your shell may resort the output by the corresponding line number of the file:
-
mdl ./example.md | sort -t ":" -k 2 -n
Recurrent (personalized) check criteria can be saved as a style. Snippet mystyle.rb below showcases the keywords for comments, rules, tags, as well as the general syntax available:
-
all # initiate with all rules implemented rule 'MD013', :line_length => 100, :ignore_code_blocks => true exclude_rule 'MD014' # tag :blockquote exclude_tag :indentation
Rules a style file activates can be listed by
-
mdl -s ./mystyle.rb -l
A personalized local style is applied during a check by markdownlint by
-
mdl -s ./mystyle.rb ./example.md
Version
This is about markdownlint version 0.13.0 (October 2nd, 2023).