#spans #markdown

ratskin

A wrapper around termimad that produces ratatui widgets from markdown

2 unstable releases

0.2.0 Jan 25, 2025
0.1.0 Jan 25, 2025

#604 in Text processing

40 downloads per month
Used in 3 crates

MIT license

14KB
250 lines

Ratskin is a wrapper around [termimad] that parses markdown into ratatui::text::Lines.

#
let rat_skin = RatSkin::default();
let text = RatSkin::parse_text("**cook it!**");
let lines: Vec<Line> = rat_skin.parse(text, 80);
assert_eq!(lines, vec![Line::from(Span::from("cook it!").bold())]);

This is all you need to know about Ratskin - for everything else, please see termimad:

Because termimad is very streamlined for writing terminal output directly (for good reasons), a small part of the logic had to be rewritten for ratatui Spans and Lines.

License: MIT


lib.rs:

Ratskin is a wrapper around [termimad] that parses markdown into ratatui::text::Lines.

let rat_skin = RatSkin::default();
let text = RatSkin::parse_text("**cook it!**");
let lines: Vec<Line> = rat_skin.parse(text, 80);
assert_eq!(lines, vec![Line::from(Span::from("cook it!").bold())]);

This is all you need to know about Ratskin - for everything else, please see termimad:

Because termimad is very streamlined for writing terminal output directly (for good reasons), a small part of the logic had to be rewritten for ratatui Spans and Lines.

Dependencies

~10–21MB
~303K SLoC