wip: more edn rendering setup

This commit is contained in:
🪞👃🪞 2025-01-05 04:48:01 +01:00
parent 174a7ee614
commit f1b3fc0040
10 changed files with 85 additions and 47 deletions

View file

@ -1,8 +1,20 @@
use tek_edn::*;
use tek_edn::{*, tek_layout::{*, tek_engine::{*, tui::{*, TuiRun}}}};
use std::sync::{Arc, RwLock};
const SOURCE: &'static str = include_str!("edn02.edn");
const EDN: &'static str = include_str!("edn02.edn");
fn main () {
Tui::run(Arc::new(RwLock::new(Demo::new())))?;
fn main () -> Usually<()> {
let state = Arc::new(RwLock::new(Example));
Tui::new().unwrap().run(&state)?;
Ok(())
}
pub struct Example;
impl EdnLayout<Tui> for Example {
fn get_content <'a> (&'a self, sym: &'a str) -> Box<EdnRender<'a, Tui>> {
Box::new(Thunk::new(move||if sym == ":hello" { "Hello world!" } else { "" }))
}
}
impl Handle<Tui> for Example {}