tui-markup 0.5.0

markup langauge for terminal styled text
Documentation
1
2
3
4
5
6
7
8
9
use std::path::Path;

use tui_markup::{compile, generator::Generator};

pub fn compile_file<G: Generator<'static> + Default, P: AsRef<Path>>(p: P) -> G::Output {
    let s = String::from_utf8(std::fs::read(p.as_ref()).unwrap()).unwrap();
    let s = Box::leak::<'static>(Box::new(s)).as_str();
    compile::<G>(s).unwrap()
}