cursive/examples/markup.rs
2018-01-10 23:58:29 +01:00

23 lines
488 B
Rust

extern crate cursive;
use cursive::Cursive;
use cursive::utils::markup::MarkdownText;
use cursive::views::{Dialog, TextView};
// Make sure you compile with the `markdown` feature!
//
// cargo run --example markup --features markdown
fn main() {
let mut siv = Cursive::new();
let text = MarkdownText("Isn't *that* **cool**?");
siv.add_layer(
Dialog::around(TextView::styled(text).unwrap())
.button("Hell yeah!", |s| s.quit()),
);
siv.run();
}