Registry / data / mdformat-tables

mdformat-tables

JSON →
library1.0.0pypypi✓ verified 22d ago

mdformat-tables is a plugin for the `mdformat` markdown formatter, designed specifically for rendering tables according to the GitHub Flavored Markdown (GFM) specification. It ensures tables are consistently formatted and properly aligned. The library is actively maintained, with its current version being 1.0.0, and follows a stable release cadence driven by updates to `mdformat`.

pip install mdformat-tables mdformat
INSTALL
IMPORT
SIG · MDFORMAT-TABLES
M
mdformat-tables
datapythonv1.0.0
Install
2.1s avg
Import
351ms
Disk
22MB
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.362s · 26.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.340s · 27MB
22MB installed
● package 22MB
Code
Verified usage

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

mdformat_tables
import mdformat_tables
Importing the package registers it as an mdformat plugin. Its functionality is then accessed via `mdformat`'s API or CLI using the plugin name 'tables'.

This example demonstrates how to use `mdformat-tables` programmatically. By simply importing `mdformat_tables`, the plugin is registered with `mdformat`. You then pass `plugins=['tables']` to `mdformat.format_markdown` to enable table formatting.

import mdformat import mdformat_tables # This registers the plugin markdown_with_table = """ | Header 1 | Header 2 | |----------|----------| | Row 1 Col 1 | Row 1 Col 2 | | Row 2 Col 1 | Row 2 Col 2 | """ formatted_markdown = mdformat.format_markdown(markdown_with_table, plugins=['tables']) print(formatted_markdown)
Debug
Known issues
breakingPython 3.6 support was dropped in `v1.0.0`. Users on older Python versions must either upgrade their Python environment or pin `mdformat-tables` to an earlier version (e.g., `<1.0.0`).
fix
Upgrade to Python 3.7+ or pin `mdformat-tables<1.0.0`.
affects: >=1.0.0
gotchaCompatibility with `mdformat` versions is crucial. `mdformat-tables` versions are often synced with specific `mdformat` versions due to internal API changes (e.g., `v0.3.0` synced with `mdformat 0.6.0`). Mismatched versions can lead to unexpected formatting or errors.
fix
Always install the latest `mdformat-tables` with the latest `mdformat` or consult their respective changelogs for specific compatibility notes. Ensure both libraries are kept up-to-date in sync.
affects: <1.0.0 (especially before v0.3.0)
gotchaPrior to `v0.4.1`, tables containing unescaped pipe characters (`|`) within cells could be incorrectly rendered or parsed, leading to malformed output.
fix
Upgrade to `mdformat-tables>=0.4.1` to ensure correct pipe escaping and table parsing.
affects: <0.4.1
gotchaBefore `v0.4.0`, lines that visually resembled table delimiter rows (e.g., `--- | ---`) but were not intended as such could be misinterpreted and incorrectly escaped, affecting non-table content.
fix
Upgrade to `mdformat-tables>=0.4.0` for improved handling of potential table delimiter rows.
affects: <0.4.0
Upgrade
Version history
1.0.0latest on PyPI · released Aug 23, 2024
Audit
Dependencies
mdformatrequiredThis package is an mdformat plugin and requires mdformat to function.
Agent activity
17 hits · last 30 days
node
16
Resources
mdformat-tables — pip install mdformat-tables · libregistry