Marcli

Marcli

CommonMark Markdown to ANSI-escaped terminal output

Marcli converts Markdown into styled terminal text using ANSI escape sequences. It parses via MDEx and renders headings, lists, code blocks, inline formatting, links, images, and more as richly styled output for terminal emulators.

Screenshot

Marcli terminal output

Supported Elements

Installation

Add marcli to your list of dependencies in mix.exs:

def deps do
  [
    {:marcli, "~> 0.1.0"}
  ]
end

Usage

# Basic rendering
output = Marcli.render("# Hello\n\nSome **bold** text.")
IO.puts(output)

# With CRLF line endings (e.g. for xterm.js)
output = Marcli.render(markdown, newline: "\r\n")

Syntax Highlighting

When a makeup_<lang> lexer library is loaded (e.g. makeup_elixir, makeup_erlang, makeup_html), fenced code blocks tagged with a language identifier are automatically syntax-highlighted using ANSI escape sequences.

Add the desired lexer(s) to your mix.exs dependencies:

{:makeup_elixir, ">= 0.0.0", optional: true}

No extra configuration is needed. Marcli detects the lexer at runtime via Makeup.Registry. If no matching lexer is available, the block renders without highlighting.

Options

Documentation

HexDocs

Credits

Created as part of the Oeditus code quality tooling ecosystem.

License

MIT