PyMarkdown is primarily a Markdown linter.
Structure‑aware linting
Instead of scanning raw text, the rules analyze tokens that represent your document's
structure: headings, list items, links, and more. With this structure‑aware view,
rules decide based on document layout rather than raw characters.
Spec‑compliant parsing
These tokens come from PyMarkdown's parser, which follows the GitHub Flavored Markdown
and CommonMark specifications. As a result, PyMarkdown
interprets your document like other tools and bases its rules on parsed structure
instead of simple line‑based pattern matching.
Together, these ideas shape how PyMarkdown analyzes your documents.
Internally, PyMarkdown is built around three related pieces that implement this behavior:
Use PyMarkdown if:
In those scenarios, PyMarkdown applies consistent, automated checks to your Markdown documents.
Start with the built‑in rules and default configuration to lint your documents immediately. To customize PyMarkdown later, use the User Guide and related pages.
The PyMarkdown project has the following advantages:
Before you install PyMarkdown, make sure your environment meets the basic requirements.
This project requires Python 3.10 or later.
For a quick start, run these two commands to install PyMarkdown globally and scan
the current directory (.):
pip install pymarkdownlnt
pymarkdown scan .
PyMarkdown also fits into different workflows, such as:
For configuration examples for each of these workflows, see the Quick Start guides linked from Jumping Off Points.
PyMarkdown includes dozens of built‑in linting rules (see the full Rules Reference). They cover common concerns such as:
Many of these rules will be familiar if you have used other Markdown linters.
Roughly 44 of the 46 built‑in rules are based on rules from the Markdown Lint project, a de‑facto standard through its VS Code plugin. We keep the original intent of those rules but adjust their behavior to follow the Markdown specifications more closely and to handle real‑world documents more reliably.
The goal is to stay familiar to existing Markdown Lint users while providing clearer, more predictable results.
As described in Core Concepts, PyMarkdown separates checks into small, focused Rule Plugins that run inside a centralized Rule Engine. Each plugin implements a single, clearly defined check (for example, "heading levels" or "list indentation"), and the engine provides full document context.
Some Markdown Lint rules combine several checks into a single rule or ignore the full document context. This can lead to missed issues and confusing error messages.
For example, a rule that enforces maximum line length does not also verify whether the line contains extra internal whitespace. In PyMarkdown, each of these related checks is handled by its own Rule Plugin:
Both rules use the same document context, yet each error message focuses on a single issue. That focus makes it easier to understand and fix reported problems.
PyMarkdown builds on familiar Markdown Lint rules but aligns them with the Markdown specifications and with typical real‑world documents, so results are more predictable and useful.
For an overview of everything that is available, see the Rules Reference and the Extensions Reference.
Most users rely on:
In addition to the command‑line modes, PyMarkdown can also be run in these ways:
For detailed command‑line usage, see:
If PyMarkdown is missing something you need, we are happy to discuss new features. In practice, most requests fall into two categories:
Building on the Core Concepts:
The Rule Engine is designed around plugins and extensions, so adding new rules or extensions fits naturally into the existing architecture.
The Extending PyMarkdown section in our "Development Documentation" explains how we add extensions and Rule Plugins to PyMarkdown. This process acts as a quality safeguard. Features may take longer to release, but the additional design, implementation, and testing make their behavior more predictable.
All detailed documentation is hosted on ReadTheDocs and is updated with each release.
Python
98.8%
PyMarkdown is primarily a Markdown linter.
Structure‑aware linting
Instead of scanning raw text, the rules analyze tokens that represent your document's
structure: headings, list items, links, and more. With this structure‑aware view,
rules decide based on document layout rather than raw characters.
Spec‑compliant parsing
These tokens come from PyMarkdown's parser, which follows the GitHub Flavored Markdown
and CommonMark specifications. As a result, PyMarkdown
interprets your document like other tools and bases its rules on parsed structure
instead of simple line‑based pattern matching.
Together, these ideas shape how PyMarkdown analyzes your documents.
Internally, PyMarkdown is built around three related pieces that implement this behavior:
Use PyMarkdown if:
In those scenarios, PyMarkdown applies consistent, automated checks to your Markdown documents.
Start with the built‑in rules and default configuration to lint your documents immediately. To customize PyMarkdown later, use the User Guide and related pages.
The PyMarkdown project has the following advantages:
Before you install PyMarkdown, make sure your environment meets the basic requirements.
This project requires Python 3.10 or later.
For a quick start, run these two commands to install PyMarkdown globally and scan
the current directory (.):
pip install pymarkdownlnt
pymarkdown scan .
PyMarkdown also fits into different workflows, such as:
For configuration examples for each of these workflows, see the Quick Start guides linked from Jumping Off Points.
PyMarkdown includes dozens of built‑in linting rules (see the full Rules Reference). They cover common concerns such as:
Many of these rules will be familiar if you have used other Markdown linters.
Roughly 44 of the 46 built‑in rules are based on rules from the Markdown Lint project, a de‑facto standard through its VS Code plugin. We keep the original intent of those rules but adjust their behavior to follow the Markdown specifications more closely and to handle real‑world documents more reliably.
The goal is to stay familiar to existing Markdown Lint users while providing clearer, more predictable results.
As described in Core Concepts, PyMarkdown separates checks into small, focused Rule Plugins that run inside a centralized Rule Engine. Each plugin implements a single, clearly defined check (for example, "heading levels" or "list indentation"), and the engine provides full document context.
Some Markdown Lint rules combine several checks into a single rule or ignore the full document context. This can lead to missed issues and confusing error messages.
For example, a rule that enforces maximum line length does not also verify whether the line contains extra internal whitespace. In PyMarkdown, each of these related checks is handled by its own Rule Plugin:
Both rules use the same document context, yet each error message focuses on a single issue. That focus makes it easier to understand and fix reported problems.
PyMarkdown builds on familiar Markdown Lint rules but aligns them with the Markdown specifications and with typical real‑world documents, so results are more predictable and useful.
For an overview of everything that is available, see the Rules Reference and the Extensions Reference.
Most users rely on:
In addition to the command‑line modes, PyMarkdown can also be run in these ways:
For detailed command‑line usage, see:
If PyMarkdown is missing something you need, we are happy to discuss new features. In practice, most requests fall into two categories:
Building on the Core Concepts:
The Rule Engine is designed around plugins and extensions, so adding new rules or extensions fits naturally into the existing architecture.
The Extending PyMarkdown section in our "Development Documentation" explains how we add extensions and Rule Plugins to PyMarkdown. This process acts as a quality safeguard. Features may take longer to release, but the additional design, implementation, and testing make their behavior more predictable.
All detailed documentation is hosted on ReadTheDocs and is updated with each release.
Python
98.8%