termimad 0.2.1

Terminal Renderer for markdown snippets
Documentation

MIT Latest Version docs Chat on Miaou

A simple tool to display static or dynamic Markdown snippets in the terminal, with skin isolation.

Based on crossterm so works on most terminals (even on windows).

text

Note that the goal isn't to display any markdown text with its various extensions (a terminal isn't really fit for that). The goal is rather to improve the display of texts in a terminal application when we want both the text and the skin to be easily configured.

Usage

[dependencies]
termimad = "0.2"

With the default skin:

termimad::print_line("**some** *nested **style*** and `some(code)`");

or

print!("{}", termimad.line("**some** *nested **style*** and `some(code)`"));

Result:

simple example

With a custom skin:

let mut skin = MadSkin::new();
skin.bold = skin.bold.fg(Yellow);
skin.print_line_ln("*Hey* **World!** Here's `some(code)`");
mad_colors!(skin.normal, Magenta, Rgb{r:30, g:30, b:40});
skin.italic.add_attr(Underlined);
println!("and now {}", skin.line("a little *too much* **style!** (and `some(code)` too)"));

Result:

too much style

Scrollable TextView in a raw terminal:

scrollable

The whole code for this example is in examples/scrollable.