| Crates.io | teacat_lib |
| lib.rs | teacat_lib |
| version | 0.1.1 |
| created_at | 2025-05-31 22:01:11.855702+00 |
| updated_at | 2025-05-31 22:11:33.095501+00 |
| description | Tools for working with TeaCat files |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1696685 |
| size | 41,298 |
This crate contains basic tools for working with TeaCat files.
use teacat_lib::prelude::*;
let teacat_str = "
&title := :title[My Webpage];
:head[
&title
]
:body[
:p[Hello, World!]
]
"
.to_string();
let tokenstream = TokenStream::lex(teacat_str);
let ast = Ast::parse(tokenstream)?;
let expanded = ExpandedAst::expand(ast)?;
let html = HtmlRenderer::render(expanded);
assert_eq!(
html,
"<!DOCTYPE html><html><head><title>My Webpage</title></head><body><p>Hello, World!</p></body></html>".to_string()
);