1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Render Markdown beautifully in the terminal.
//!
//! The renderer behind the `mrk` command: it turns Markdown into a [`Document`](document::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.
/// Runs the Rust snippets of `docs/library.md` as doctests, so the guide compiles against the API it describes.
;