MkDocs Flavor

February 25, 2026 ยท View on GitHub

For projects using MkDocs or Material for MkDocs.

Supported Patterns

Auto-References

MkDocs autorefs plugin allows shorthand links to documented objects:

See [ClassName][] for details.
Use [module.function][] in your code.

Affected rules: MD042 (empty links), MD052 (reference links)

Admonitions

MkDocs admonition syntax is recognized:

!!! note "Title"
    Content inside admonition.

!!! warning
    Warning content.

??? tip "Collapsible"
    Hidden content.

Affected rules: MD031 (blanks around fences), MD046 (code block style)

Content Tabs

Material for MkDocs tab syntax:

=== "Tab 1"
    Content for tab 1.

=== "Tab 2"
    Content for tab 2.

Affected rules: MD046 (code block style)

Snippets

MkDocs snippets for including external files:

--8<-- "path/to/file.md"
;--8<--

Affected rules: MD024 (duplicate headings), MD052 (reference links)

HTML with Markdown Attribute

Allows markdown, markdown="1", or markdown="block" to enable Markdown processing inside HTML elements. This includes Material for MkDocs grid cards pattern:

<div class="grid cards" markdown>

-   :zap:{ .lg .middle } **Built for speed**

    ---

    Written in Rust for blazing fast performance.

</div>

Supported elements: div, section, article, aside, details, figure, footer, header, main, nav.

Affected rules: MD030 (list marker space), MD033 (inline HTML), MD035 (HR style)

Code Block Title Attribute

MkDocs allows title= on fenced code blocks:

```python title="example.py"
print("Hello")
```

Affected rules: MD040 (fenced code language)

Table Extensions

MkDocs table handling with extensions like md_in_html:

Affected rules: MD056 (table column count)

mkdocstrings Blocks

mkdocstrings autodoc syntax is recognized:

::: module.path
    options:
        show_source: true

::: package.submodule.Class

Affected rules: MD031 (blanks around fences), MD038 (code spans)

PyMdown Blocks

PyMdown Blocks syntax using /// fences is recognized:

/// details | Summary
    type: warning

Content inside the block.

///

/// caption
Figure 1: Example diagram
///

/// html | div.custom-class

Custom HTML content with markdown.

///

Block types include: admonition, details, caption, html, tab, and custom blocks.

Affected rules: MD012, MD018, MD022, MD025, MD030, MD033, MD036, MD057, MD059, MD064 (all skip content inside blocks)

Extended Markdown Syntax

MkDocs extensions for special formatting:

++inserted text++     <!-- ins extension -->
==marked text==       <!-- mark extension -->
^^superscript^^       <!-- caret extension -->
~subscript~           <!-- tilde extension -->
[[keyboard keys]]     <!-- keys extension -->

Affected rules: MD038 (code spans), MD049 (emphasis style), MD050 (strong style)

Rule Behavior Changes

RuleStandard BehaviorMkDocs Behavior
MD024Flag duplicate headingsSkip headings in snippet sections
MD030Check list marker spacingSkip inside markdown-enabled HTML
MD031Require blanks around all fencesRespect admonition/tab/mkdocstrings
MD033Flag all inline HTMLAllow markdown attribute on elements
MD035Check horizontal rule styleSkip inside markdown-enabled HTML
MD038Flag spaces in code spansHandle keys/caret/mark syntax
MD040Require language on code blocksAllow title= without language
MD042Flag empty links []()Allow auto-references [Class][]
MD046Detect code block style globallyAccount for admonition/tab context
MD049Check emphasis consistencyHandle mark/inserted syntax
MD050Check strong consistencyHandle mark/caret/tilde syntax
MD051Validate all fragment linksSkip footnote and option anchors
MD052Flag undefined referencesAllow auto-references and snippets
MD056Strict column countHandle MkDocs table extensions
MD077Content column W+N indentEnforce min 4-space continuation indent

Configuration

[global]
flavor = "mkdocs"

Or for specific directories:

[per-file-flavor]
"docs/**/*.md" = "mkdocs"

When to Use

Use the MkDocs flavor when:

  • Building documentation with MkDocs
  • Using Material for MkDocs theme
  • Using mkdocstrings for API documentation
  • Using PyMdown Extensions

Extension Support Reference

The MkDocs flavor provides lint-aware support for the common Python-Markdown and PyMdown Extensions used in the MkDocs ecosystem.

Support Levels

Each extension has one of these support levels:

LevelMeaning
Lint-saferumdl won't flag valid extension syntax as violations
Fix-safe--fix preserves extension constructs unchanged
Format-awareReflow/formatting respects extension structure (e.g., preserves indentation during MD013 reflow)

Python-Markdown Extensions

ExtensionLevelDescription
abbrLint-safe, Fix-safeAbbreviation definitions *[HTML]: Hypertext Markup Language
admonitionFormat-awareAdmonition blocks !!! note with indentation-aware reflow
attr_listLint-safe, Fix-safeAttribute lists {#id .class}
def_listLint-safe, Fix-safeDefinition lists with : markers
footnotesLint-safe, Fix-safeFootnotes [^1], definitions, and anchor links #fn:1
md_in_htmlLint-safe, Fix-safemarkdown="1" attribute on HTML elements
tocLint-safe, Fix-safe[TOC] markers are preserved
tablesLint-safe, Fix-safeStandard table support
metaLint-safe, Fix-safeYAML frontmatter detection
fenced_codeLint-safe, Fix-safeFenced code blocks with attributes
codehiliteN/ARendering-only (no linting impact)

PyMdown Extensions

ExtensionLevelDescription
arithmatexLint-safe, Fix-safeMath blocks $$ ... $$ and inline $...$
betteremLint-safe, Fix-safeStandard emphasis handling applies
blocksLint-safe, Fix-safePyMdown Blocks /// type with /// fence syntax
caretLint-safe, Fix-safeSuperscript ^text^ and insert ^^text^^
criticLint-safe, Fix-safeCritic markup {++add++}, {--del--}
detailsLint-safe, Fix-safeCollapsible blocks ??? note and ???+ note
emojiLint-safe, Fix-safeEmoji/icon shortcodes :material-check:
highlightN/ARendering-only (no linting impact)
inlinehiliteLint-safe, Fix-safeInline code highlighting `#!python code`
keysLint-safe, Fix-safeKeyboard keys ++ctrl+alt+del++
markLint-safe, Fix-safeHighlighted text ==text==
smartsymbolsLint-safe, Fix-safeSmart symbols (c), (tm), -->
snippetsLint-safe, Fix-safeFile inclusion --8<-- "file.md"
superfencesLint-safe, Fix-safeCustom fences with language + attributes
tabbedFormat-awareContent tabs === "Tab" with indentation-aware reflow
tasklistLint-safe, Fix-safeTask lists - [x] Task (standard GFM)
tildeLint-safe, Fix-safeSubscript ~text~ and strikethrough ~~text~~

mkdocstrings

FeatureLevelDescription
Auto-doc blocksFormat-aware::: module.Class with YAML options, indentation-aware reflow
Cross-referencesLint-safe, Fix-safe[module.Class][] reference links

See Also