mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 11:16:03 +00:00
Fix example without markdown feature
This commit is contained in:
parent
890b3f13e1
commit
5dcce6a965
@ -1,6 +1,7 @@
|
|||||||
extern crate cursive;
|
extern crate cursive;
|
||||||
|
|
||||||
use cursive::Cursive;
|
use cursive::Cursive;
|
||||||
|
#[cfg(feature = "markdown")]
|
||||||
use cursive::utils::markup::MarkdownText;
|
use cursive::utils::markup::MarkdownText;
|
||||||
use cursive::views::{Dialog, TextView};
|
use cursive::views::{Dialog, TextView};
|
||||||
|
|
||||||
@ -11,8 +12,12 @@ use cursive::views::{Dialog, TextView};
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut siv = Cursive::new();
|
let mut siv = Cursive::new();
|
||||||
|
|
||||||
|
#[cfg(feature = "markdown")]
|
||||||
let text = MarkdownText("Isn't *that* **cool**?");
|
let text = MarkdownText("Isn't *that* **cool**?");
|
||||||
|
|
||||||
|
#[cfg(not(feature = "markdown"))]
|
||||||
|
let text = "Rebuild with --features markdown ;)";
|
||||||
|
|
||||||
siv.add_layer(
|
siv.add_layer(
|
||||||
Dialog::around(TextView::styled(text).unwrap())
|
Dialog::around(TextView::styled(text).unwrap())
|
||||||
.button("Hell yeah!", |s| s.quit()),
|
.button("Hell yeah!", |s| s.quit()),
|
||||||
|
Loading…
Reference in New Issue
Block a user