ratatui / ratatui-macros

Macros for simplifying boilerplate for creating UI using Ratatui.
https://ratatui.rs
MIT License
28 stars 2 forks source link

feat(text): add raw! and styled! macros #4

Closed joshka closed 10 months ago

joshka commented 10 months ago

These macros are similar to the format! macro, but return a raw or styled Span instead of a String.

use ratatui_macros::{raw, styled};

let name = "world";
raw!("Hello, {name}!");
styled!(Style::new().green(), "Hello, {name}!");
styled!(Color::Green, "Hello, {name}!");
styled!(Modifier::BOLD, "Hello, {name}!");
joshka commented 10 months ago

Looks good! Should we add a note to the README?

done