teacat_lib 0.3.0

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 ast = TeaCatAst::try_from(tc_str)?;
let expanded = ExpandedAst::expand(ast)?;
let html = HtmlRenderer::render(expanded);

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