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

toml [dependencies] termimad = "0.2"

With the default skin:

rust termimad::print_inline("**some** *nested **style*** and `some(code)`"); or rust print!("{}", termimad.inline("**some** *nested **style*** and `some(code)`"));

Result:

simple example

With a custom skin:

rust 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 code for this example is in examples/scrollable. To read the whole text just do

cargo run --example scrollable