Registry / devops / mdformat-gfm-alerts

mdformat-gfm-alerts

JSON →
library2.0.0pypypi✓ verified 84d ago

An mdformat plugin for GitHub-flavored Markdown alerts. This plugin adds support for rendering GFM alert blocks (e.g., > [!NOTE]) using mdformat. Current version 2.0.0, requiring Python >=3.9.0. Active development with periodic releases.

pip install mdformat-gfm-alerts
INSTALL
IMPORT
SIG · MDFORMAT-GFM-ALERT
M
mdformat-gfm-alerts
devopspythonv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
from mdformat_gfm_alerts import plugin
Use 'mdformat_gfm_alerts' (not 'mdformat-gfm-alerts', which is the package name).

Load and apply the gfm_alerts plugin to format alert blocks with mdformat.

import mdformat from mdformat_gfm_alerts import plugin text = "> [!NOTE]\n> This is a note.\n" mdformat.text(text, extensions=["gfm_alerts"], options={"plugin_overrides": {"gfm_alerts": plugin}}) # Result: same, but formatted according to mdformat rules
Debug
Known issues
gotchaThe plugin does not auto-register with mdformat; you must explicitly pass the extension and override options.
fix
Always include 'extensions=["gfm_alerts"]' and 'options={"plugin_overrides": {"gfm_alerts": plugin}}' when calling mdformat functions.
affects: all
deprecatedVersion 2.0.0 may have changed plugin configuration syntax from earlier betas; check compatibility if upgrading.
fix
Review changelog for migration steps; ensure using the correct import path and option keys.
affects: <2.0.0
gotchaOnly GFM alert syntax is supported (e.g., > [!NOTE], > [!WARNING]); custom alert markers are not formatted.
fix
Stick to standard GFM alert types (NOTE, TIP, IMPORTANT, WARNING, CAUTION).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mdformat_gfm_alerts'
Package not installed or installed under a different name.
fix
Run 'pip install mdformat-gfm-alerts' or verify installation with 'pip list | grep mdformat-gfm-alerts'.
mdformat.errors.MarkdownParsingError: Failed to parse markdown for extension 'gfm_alerts'
The plugin expects a specific version of mdformat or the markdown contains malformed alerts.
fix
Ensure mdformat is up to date (pip install -U mdformat) and that alert blocks follow GFM syntax (e.g., > [!NOTE] on its own line).
TypeError: text() got an unexpected keyword argument 'extensions'
Using an older version of mdformat that does not support extensions parameter.
fix
Upgrade mdformat to the latest version: pip install -U mdformat.
Upgrade
Version history
2.0.0latest on PyPI · released Jun 5, 2025
Audit
Dependencies
mdformatrequiredCore formatter that this plugin extends; must be installed alongside.
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources

No resource links recorded.

mdformat-gfm-alerts — pip install mdformat-gfm-alerts · libregistry