mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
39405ba1ec
We now use mostly indexed spans into a source string. Indexed Spans can still be resolved to a string slice when needed.
27 lines
617 B
Rust
27 lines
617 B
Rust
extern crate cursive;
|
|
|
|
use cursive::Cursive;
|
|
#[cfg(feature = "markdown")]
|
|
use cursive::utils::markup::markdown;
|
|
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 = markdown::parse("Isn't *that* **cool**?");
|
|
|
|
#[cfg(not(feature = "markdown"))]
|
|
let text = "Rebuild with --features markdown ;)";
|
|
|
|
siv.add_layer(
|
|
Dialog::around(TextView::new(text)).button("Hell yeah!", |s| s.quit()),
|
|
);
|
|
|
|
siv.run();
|
|
}
|