use rich_rust::prelude::*;
fn main() {
let console = Console::new();
console.print("[bold]Hello[/bold], [red]World[/red]!");
console.print("[green]Success![/] [yellow]Warning[/] [red]Error[/]");
console.print("[bold italic blue]Bold italic blue text[/]");
let mut text = Text::new("Programmatic ");
let style = Style::parse("bold magenta").unwrap_or_default();
text.append_styled("styled", style);
text.append(" text!");
for segment in text.render("\n") {
print!("{}", segment.text);
}
console.rule(Some("Section Title"));
console.print_plain("[This is not markup - brackets are literal]");
console.print_styled("Explicitly styled text", Style::new().bold().italic());
}