Oven logo

Oven

Published

Mdformat plugin for GitHub Flavored Markdown compatibility

pip install mdformat-gfm

Package Downloads

Weekly DownloadsMonthly Downloads

Requires Python

>=3.10

Build Status PyPI version

mdformat-gfm

Mdformat plugin for GitHub Flavored Markdown compatibility

Description

Mdformat is a formatter for CommonMark compliant Markdown.

Mdformat-gfm is an mdformat plugin that changes the target specification to GitHub Flavored Markdown (GFM), making the tool able to format the following syntax extensions:

Install

pipx install mdformat
pipx inject mdformat mdformat-gfm

Usage

mdformat <filename>

Configuration

Mdformat-gfm distribution includes two plugins identified as gfm and tables. The gfm plugin adds support for all GFM syntax (including tables). Enabling tables only adds tables support.

Mdformat-gfm adds a --compact-tables CLI option and a corresponding compact_tables TOML boolean. Turning this on will strip extra spaces from GFM tables that are otherwise used to align table columns.

To use the option on the command line, do

mdformat --compact-tables <filename>

Alternatively add the following in a .mdformat.toml configuration file

[plugin.tables]
compact_tables = true