mdformat-ruff
Mdformat plugin to ruffen Python code blocks
Decision gist · record as of 2026-08-14
Yes, if you use mdformat for Markdown formatting and want Python code blocks formatted by ruff. Install friction is minimal and the plugin integrates transparently. The aging maintenance status is a minor concern—no recent updates—but the package remains functional and unarchived with no known vulnerabilities. Suitable for documentation workflows where ruff is already your Python formatter.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with a single runtime dependency (ruff).
- Maintenance status is aging—last release was over a year ago, though the repository remains unarchived.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal obligations.
last release 2024-02-11 (915 days) · last repo commit 2025-03-09 · 28 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 122,041 downloads/mo, #11,963 on PyPI
Alternatives
Verify before relying
pip install mdformat-ruff
import mdformat
unformatted = "```python\n'''ruff converts quotes'''\n```\n"
formatted = mdformat.text(unformatted, codeformatters={"python"})
assert formatted == '```python\n"""ruff converts quotes"""\n```\n'- Whether ruff version pinning (e.g., ruff==22.1.0) remains necessary for current versions.
- Compatibility with recent mdformat releases and how often updates are planned.
What it is and what it does
mdformat-ruff is a plugin for mdformat that applies ruff formatting rules to Python code blocks embedded in Markdown files. When installed, it automatically enables ruff as the code formatter for Python blocks when you run mdformat from the command line, or you can explicitly enable it via the mdformat Python API by passing python to the codeformatters parameter.
The plugin depends only on ruff and integrates into mdformat's plugin architecture. It works with Python 3.7 through 3.12 and is commonly used in documentation workflows and pre-commit hooks to ensure Python code examples in Markdown stay consistently formatted.
Use it for
- Format Python code examples in project README and documentation files to match your ruff configuration.
- Enforce consistent code style in Markdown-based documentation as part of a pre-commit hook workflow.
- Automatically convert Python string quotes in code blocks when ruff is configured to do so.
- Maintain formatting consistency between Python code blocks in Markdown and the main codebase during CI/CD checks.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use mdformat for Markdown formatting and want Python code blocks formatted by ruff.
Install friction is minimal and the plugin integrates transparently. The aging maintenance status is a minor concern—no recent updates—but the package remains functional and unarchived with no known vulnerabilities. Suitable for documentation workflows where ruff is already your Python formatter.
Install
mdformat-ruff on PyPI
Before you install
Low friction install with a single runtime dependency (ruff). Maintenance status is aging—last release was over a year ago, though the repository remains unarchived.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations.
Quickstart
pip install mdformat-ruff
import mdformat
unformatted = "```python\n'''ruff converts quotes'''\n```\n"
formatted = mdformat.text(unformatted, codeformatters={"python"})
assert formatted == '```python\n"""ruff converts quotes"""\n```\n'
Verify before relying
- Whether ruff version pinning (e.g., ruff==22.1.0) remains necessary for current versions.
- Compatibility with recent mdformat releases and how often updates are planned.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7,<4.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageruff |
| Maintenance | Aging 915 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,041 / month, #11,963 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Text Processing :: MarkupTyping :: Typed |
Evidence: mdformat_ruff-0.1.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mdformat plugin ruff”
- mdformat-ruffIntegrates ruff code formatting into mdformat to automatically format…
- mdformat-footnoteAdds footnote parsing and formatting support to mdformat, enabling…
- mdformat_deflistExtends mdformat with support for parsing and formatting definition…
Give your agent the search over MCP, or paste the wish link into any chat.
More Markup packages
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.
Install it if you need reliable markdown-to-HTML conversion.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.
Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.
Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.
Install it if you're building tools that touch TOML files and user readability of the source matters.
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
See also mdformat-black · mdformat · ruff-format · mdformat-toc · mdformat_myst · mdformat-gfm · blacken-docs · mdformat_tables · md2Slack · doccmd