teacat_lib 0.5.2

Tools for working with TeaCat files
Documentation

TeaCat Lib

This crate contains basic tools for working with TeaCat files.

use teacat_lib::prelude::*;

let tc_str = "
# simple website

:head [
	:title My Website
]

:body [
	:p Hello, World!
]
";

let mut executor = Executor::default();
let ast = TeaCatAst::try_from(tc_str)?;
let dom = executor.exec_ast(ast)?;
let html = HtmlRenderer::render(dom);

assert_eq!(
	html,
	"<!DOCTYPE html><html><head><title>My Website</title></head> <body><p>Hello, World!</p></body></html>".to_string()
);