mdformat-gfm1.0.0
Published
Mdformat plugin for GitHub Flavored Markdown compatibility
pip install mdformat-gfm
Package Downloads
Authors
Requires Python
>=3.10
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:
- tables
- task list items
- strikethroughs
- autolinks
- disallowed raw HTML (note that no changes are required from a formatter to support this extension)
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