discount 1.0.0

Markdown parser and display library for terminals
Documentation
# Discount - A terminal-oriented Markdown parser

> This is my Markdown parser.  
> There are many like it, but this one is mine.

In fact, there are not many like it. Most Markdown parsers are focused on
outputting Markdown text as HTML. **Discount** is focused on outputting text
that is suitable for display in a terminal.

"But Markdown is plaintext that is already suitable for display on a
terminal!" you wail. That's true, but sometimes it's nice to see colors and
underlines and other styling, even when you're locked into the command line.
That's where Discount comes in: the parser not only styles text according to
some basic rules, but it wraps text to the width of the terminal. And it
styles text based on the capabilities of the most basic of terminals: it
doesn't use any styling beyond underlining and bold ("bright") text, so it's
still as easy on the eyes as plaintext.

Discount consists of two distinct parsers:

- **terminal** formats a Markdown document for display in the terminal, with
  basic styling like underling and bold text, as well as indentation for lists
  and code blocks. It wraps text to the width of the terminal, including
  indented text. It makes Markdown look even nicer to read in terminals!

- **plain** strips all formatting instructions from Markdown source code,
  emitting only the content of the Markdown document. It completely removes
  link URLs, quoted text, headers, image links, and other text accoutrement.

  The plain parser is primarily useful for returning stripped text suitable
  for passing to an LLM. Thus it is not a completely accurate summary, as some
  text is completely removed, but it should be "good enough" for an LLM.

Pick the poison suitable to your project.

## See also

- [CommonMark]https://commonmark.org/, for the CommonMark specification.
- [ANSI Escape Sequences]https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797>,
  for the full rundown of ANSI terminal escape codes.