Skip to main content

CommonMark compliant Markdown formatter

Project description

Documentation Status Build Status codecov.io PyPI version

mdformat

CommonMark compliant Markdown formatter

Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files. Mdformat is a Unix-style command-line tool as well as a Python library.

Find out more in the docs.

Installing

Install with CommonMark support:

pip install mdformat

Alternatively install with GitHub Flavored Markdown (GFM) support:

pip install mdformat-gfm

Command line usage

Format files

Format files README.md and CHANGELOG.md in place

mdformat README.md CHANGELOG.md

Format .md files in current working directory recursively

mdformat .

Read Markdown from standard input until EOF. Write formatted Markdown to standard output.

mdformat -

Check formatting

mdformat --check README.md CHANGELOG.md

This will not apply any changes to the files. If a file is not properly formatted, the exit code will be non-zero.

Options

foo@bar:~$ mdformat --help
usage: mdformat [-h] [--check] [--version] [--number]
                [--wrap {keep,no,INTEGER}]
                [paths [paths ...]]

CommonMark compliant Markdown formatter

positional arguments:
  paths                 files to format

optional arguments:
  -h, --help            show this help message and exit
  --check               do not apply changes to files
  --version             show program's version number and exit
  --number              apply consecutive numbering to ordered lists
  --wrap {keep,no,INTEGER}
                        paragraph word wrap mode (default: keep)

Documentation

This README merely provides a quickstart guide for the command line interface. For more information refer to the documentation. Here's a few pointers to get you started:

Frequently Asked Questions

What's wrong with the mdformat logo? It renders incorrectly and is just terrible in general.

Nope, the logo is actually pretty great – you're terrible. The logo is more a piece of art than a logo anyways, depicting the horrors of poorly formatted text documents. I made it myself.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdformat-0.6.3.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdformat-0.6.3-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file mdformat-0.6.3.tar.gz.

File metadata

  • Download URL: mdformat-0.6.3.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.10 Linux/5.4.0-1043-azure

File hashes

Hashes for mdformat-0.6.3.tar.gz
Algorithm Hash digest
SHA256 e45970880d2ddd153c4bdee821987cd46dcc715dbf9ad516b3324fd7bcebf496
MD5 d37fb31ac4d7a7e71bd32430df2d6ec1
BLAKE2b-256 0f2a7bb2150a91fb5268d61bf3b6f83decb4b9594b21e75fea8032a3e7bd5f8c

See more details on using hashes here.

File details

Details for the file mdformat-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: mdformat-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.10 Linux/5.4.0-1043-azure

File hashes

Hashes for mdformat-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 28e831a4141f7875b624071a141bfc73fbba6d797dd3993096ff60d72c0576cf
MD5 8385c6bdca00f232843f872212c94599
BLAKE2b-256 46e13b2d443e3ec61f1504e305a18ab9151af353e8fbf6d08d574ea703f00358

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page