mdfmt

command
v0.0.0-...-6d4bf48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Command mdfmt canonicalizes the formatting of a Markdown document.

Usage:

mdfmt <inp.md >out.md

For now, only whitespace is canonicalized:

  • Trailing whitespace is removed from each line;
  • Multiple blank lines are collapsed down to one;
  • Before each heading line (that begins with #), a blank line is added for each heading level being unwound.

For example, given this input:

# Heading 1a

some text
## Heading 2

more text

# Heading 1b

This program will produce:

# Heading 1a

some text

## Heading 2

more text

# Heading 1b

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL