trellis 0.1.0
trellis: ^0.1.0 copied to clipboard
A Thymeleaf-inspired HTML template engine for Dart. Natural HTML templates with tl:* attributes, fragment-first design for HTMX, AOT-compatible.
Changelog #
0.1.0 #
Added #
- Core template engine with 15
tl:*attributes for natural HTML templating - Text substitution:
tl:text(escaped) andtl:utext(unescaped HTML) - Conditionals:
tl:ifandtl:unless - Iteration:
tl:eachwith status variables (index, count, size, first, last, odd, even, current) - Fragment system:
tl:fragment,tl:insert,tl:replacewith cross-file inclusion - Local variable binding:
tl:with - Attribute setting:
tl:attr,tl:href,tl:src,tl:value,tl:class,tl:id - Expression evaluator:
${var}variables,@{/url}URL expressions, string literals, ternary, Elvis, comparisons, boolean operators - Four public API methods:
render(),renderFile(),renderFragment(),renderFileFragment() - DOM caching with deep-clone for performance
- Configurable attribute prefix (default
tl) FileSystemLoaderwith security boundary enforcement (path traversal, symlink escape protection)MapLoaderfor in-memory templates and testing- Typed exception hierarchy:
TemplateException,ExpressionException,FragmentNotFoundException,TemplateNotFoundException,TemplateSecurityException - Benchmark harness:
dart run benchmark/cache_benchmark.dartfor cache on/off median latency and RSS probe
0.0.1-dev.1 #
- Name reservation on pub.dev