{"repo":"lalinsky/zt","free":true,"listed":false,"github":"https://github.com/lalinsky/zt","clone":"git clone https://github.com/lalinsky/zt.git","description":"HTML template language that compiles to Zig","language":"C","stars":30,"topics":["html","template","web-development","zig","zig-package"],"license":null,"category":"dev-tools","readme_excerpt":"Zig Templating This is still an experimental project. Feedback is welcome, but use with caution. A small HTML templating language that compiles to Zig at build-time. Inspired by [Templ], [Zeix] and [JSX]. The idea is to invent as little syntax as possible, just enough to make it possible to interweave real Zig code with HTML elements. Using this approach, the template compiler can stay very simple and delegate Zig code analysis to the real Zig compiler. Templates are transpiled into Zig source files as part of zig build , so you can just import them like any other source files in your application. Everything is fully type-checked by the Zig compiler, and there is no overhead at runtime. Output is directly written to a std.Io.Writer , so there is no state and no allocations. [JSX]: https://react.dev/learn#writing-markup-with-jsx [Zeix]: https://ziex.dev/ [Templ]: https://templ.guide/ Installation Configure your build.zig : Usage --- Example --- Syntax Templates Templates are defined with templ and compile to structs with a render method: Zig Code Standard Zig code goes at the top of the file and is passed through unchanged: --- Elements All HTML elements must be explicitly closed, but void elements like and will be rendered correctly without the closing slash. --- Attributes Static - quoted string values: Dynamic - Zig expressions in braces: Interpolated - mix static and dynamic parts: Boolean - presence means true: Optional - attribute omitted when value is null: --- Expressi","default_branch":null,"files":null,"tree":[],"storefront":"/r/lalinsky","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lalinsky/zt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}