Skip to main content

Crate mrk

Crate mrk 

Source
Expand description

Render Markdown beautifully in the terminal.

The renderer behind the mrk command: it turns Markdown into a Document of styled lines, with code highlighted and Mermaid diagrams drawn as text or as PNG pictures. It never prints; writing the document to a terminal is terminal’s job, behind the default cli feature.

use mrk::document::{self, Settings};
use mrk::markdown;

let mut settings = Settings::default();
settings.width = 40;
let rendered = markdown::render("# Notes\n\n- one\n- two\n", &settings);
print!("{}", document::printable(&rendered));

Print only through sanitize, Line::printable or document::printable: Markdown is untrusted input and a terminal interprets escape sequences. The guide is docs/library.md in the repository.

Modules§

code
diff
Pairs the sections of two versions of a Markdown file and marks the words that changed.
document
markdown
mermaid
sanitize
Text and links made safe to write to a terminal, which interprets the escape sequences an untrusted input can carry.
terminalcli
theme