Registry / serialization / mdformat-gfm

mdformat-gfm

JSON →
library1.0.0pypypi✓ verified 22d ago

Mdformat-gfm is an mdformat plugin that extends the core mdformat library to support GitHub Flavored Markdown (GFM) syntax extensions, including tables, task list items, strikethroughs, and autolinks. It allows mdformat to properly format Markdown files that utilize these GFM features. The library is currently at version 1.0.0 and typically releases new versions in sync with its parent library, mdformat.

pip install mdformat mdformat-gfm
INSTALL
IMPORT
SIG · MDFORMAT-GFM
M
mdformat-gfm
serializationpythonv1.0.0
Install
2.2s avg
Import
113ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.116s · 27.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.110s · 28MB
23MB installed
● package 23MB
Code
Verified usage

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

mdformat
import mdformat
mdformat-gfm is an auto-discovered plugin; its functionality is accessed through the mdformat API by specifying extensions.

This quickstart demonstrates how to use `mdformat` with the `mdformat-gfm` plugin via its Python API. The `mdformat-gfm` plugin is automatically loaded by `mdformat` once installed, and its GFM capabilities are enabled by passing `extensions=['gfm']` to `mdformat.text()` or `mdformat.file()`.

import mdformat unformatted_gfm = """ # My GFM Document - [ ] Task list item - [x] Another task | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | This is a ~~strikethrough~~ text. """ # To format a string with GFM support: formatted_text = mdformat.text(unformatted_gfm, extensions=['gfm']) print(formatted_text) # To format a file in place: # with open('my_gfm_file.md', 'w') as f: # f.write(unformatted_gfm) # mdformat.file('my_gfm_file.md', extensions=['gfm']) # with open('my_gfm_file.md', 'r') as f: # print(f.read())
Debug
Known issues
breakingmdformat-gfm, via its dependency on mdformat 1.0.0, no longer supports Python 3.9. Users must upgrade to Python 3.10 or newer.
fix
Upgrade your Python environment to 3.10 or later.
affects: >=1.0.0
deprecatedThe separate `mdformat-tables` plugin has been deprecated. Table formatting support is now included directly within `mdformat-gfm`. Users should migrate from `mdformat-tables` to `mdformat-gfm` for table support.
fix
Remove `mdformat-tables` and ensure `mdformat-gfm` is installed. Use the `gfm` extension for full GFM (including tables) support.
affects: All versions
gotchaThere is no guarantee for a stable Markdown formatting style across `mdformat` versions (which `mdformat-gfm` depends on). Formatting output might change in minor or patch releases.
fix
It is highly recommended to pin the `mdformat` and `mdformat-gfm` dependencies to exact versions in your project to ensure consistent formatting results.
affects: All versions
gotchaCombining `mdformat-gfm` with other `mdformat` plugins (e.g., `mdformat-admon`) can sometimes lead to dependency conflicts, particularly with underlying `mdit-py-plugins` versions.
fix
If conflicts arise, try updating all `mdformat` related plugins to their latest compatible versions or review the dependency trees for conflicting `markdown-it-py` or `mdit-py-plugins` requirements.
affects: All versions
gotchaThe `mdformat-gfm` plugin allows configuration of 'compact tables' via a `--compact-tables` CLI option or `compact_tables` TOML boolean. When enabled, this strips extra spaces used for column alignment in GFM tables.
fix
If precise table alignment is desired, ensure `--compact-tables` is not used in the CLI or `compact_tables` is set to `false` in your TOML configuration.
affects: All versions
Upgrade
Version history
1.0.0latest on PyPI · released Oct 16, 2025
Audit
Dependencies
mdformatrequiredmdformat-gfm is a plugin for the mdformat formatter and requires it to function.
Agent activity
5 hits · last 30 days
node
4
Resources
mdformat-gfm — pip install mdformat-gfm · libregistry