/mdt

mdt (markdown terminal previewer) pretty-prints CommonMark docs to the term

Primary LanguageRust

mdt


Build Status

mdt is a markdown previewer for the terminal. It takes markdown as input from stdin and prints it out formatted for easy reading. It should support all CommonMark docs (but won't attempt inner html). There are a few things still not working, and the code could use a refactor, but the main work is done.

It uses pulldown_cmark for parsing markdown.

Usage

mdt can take a file name or input from stdin. Therefore, the follow all work:

$ mdt README.md
$ cat README.md | mdt
[...]

or, more tersely,

$ mdt < README.md
[...]

If you have a terminal that supports truecolor (24-bit color), you can pass a flag -t to improve the output color. Default terminal colors map to 256-bit color. Unfortunately it doesn't seem like there's a good way to detect truecolor. If anyone knows of a way please PR or suggest how.

Supported Markdown Features

  1. paragraph
  2. rule
  3. headers
  4. lists (ordered and unordered)
  5. bold
  6. italic
  7. footnotes
  8. links
  9. tables (ascii+unicode-- although word wrap doesn't work quite right)

Not working:

  1. Images
  2. Inline html (not planned)