mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 19:26:09 +00:00
28 lines
643 B
Rust
28 lines
643 B
Rust
extern crate cursive;
|
|
|
|
use cursive::Cursive;
|
|
#[cfg(feature = "markdown")]
|
|
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();
|
|
|
|
#[cfg(feature = "markdown")]
|
|
let text = MarkdownText("Isn't *that* **cool**?");
|
|
|
|
#[cfg(not(feature = "markdown"))]
|
|
let text = "Rebuild with --features markdown ;)";
|
|
|
|
siv.add_layer(
|
|
Dialog::around(TextView::styled(text).unwrap())
|
|
.button("Hell yeah!", |s| s.quit()),
|
|
);
|
|
|
|
siv.run();
|
|
}
|