- Lexer now emits start_pug_interpolation/end_pug_interpolation tokens
- Sub-lexer parses content inside #[...] as full Pug syntax
- Supports tags with attributes, classes, IDs, and buffered code
- Added tag_interp_test.zig with 8 test cases
- Memory management: sub-lexer buffers tracked and freed properly
Examples now working:
p Dear #[strong= "asdasd"] -> <p>Dear <strong>asdasd</strong></p>
p This is #[em emphasized] text -> <p>This is <em>emphasized</em> text</p>
p Click #[a(href='/') here] -> <p>Click <a href="/">here</a></p>
Mixin definitions from included files were being rendered as content.
Now generateNode explicitly skips mixin definitions (node.call=false)
while still processing expanded mixin calls.
Bump version to 0.3.12
- Flush static buffer at end of each conditional branch (if/else/else-if)
to ensure content is rendered inside the correct blocks
- Add helpers_path parameter to zig_codegen.generate() for correct
relative imports in nested directories (e.g., '../helpers.zig')
- Fix build.zig to use correct CLI path (src/tpl_compiler/main.zig)
- Export zig_codegen from root.zig for CLI module usage
Bump version to 0.3.11
- mixin.zig: expandNode and expandNodeWithArgs now recurse into
node.consequent and node.alternate for Conditional nodes
- view_engine.zig: process includes and collect mixins from child
template before extracting blocks in processExtends
This fixes mixin calls inside if/else blocks not being rendered
in compiled templates.
- Renamed std.ArrayListUnmanaged to std.ArrayList across all source files
- Updated CLAUDE.md with Zig version standards rule
- Removed debug print from mixin test
- No API changes (allocator still passed to methods)
- Move isHtmlEntity to runtime.zig (was duplicated in codegen.zig and template.zig)
- Move appendTextEscaped to runtime.zig (was in template.zig)
- Add isXhtmlDoctype helper to runtime.zig for doctype detection
- Update template.zig to use codegen.void_elements instead of local isSelfClosing
- Update codegen.zig and zig_codegen.zig to use shared functions
- Update CLAUDE.md with shared utilities documentation
This establishes runtime.zig as the single source of truth for shared
utilities across all three rendering modes (codegen, template, zig_codegen).
- parser.zig: collect and merge all class values (shorthand and parenthesized) into single attribute
- Filter out empty, null, undefined class values during parsing
- Reverted redundant merging logic from codegen.zig, template.zig, zig_codegen.zig
- Added documentation about shared AST consumers relationship
- zig_codegen.zig: collect and merge class values in both static and dynamic attribute paths
- Completes the fix for multiple classes (.a.b -> class="a b") across all rendering modes
- codegen.zig: collect class values and output as single merged attribute
- template.zig: respect quoted flag to prevent data lookup for static class values
- Added tests for multiple class merging scenarios
- Rename parseWithIncludes to parseTemplate for clarity
- Add resolveRelativePath to handle ../path and ./path relative to current file
- Paths without ./ or ../ prefix are relative to views_dir root (Pug convention)
- Fix duplicate include processing when extends loads parent with includes
- Add tests for relative path resolution
- All paths still validated against views_dir root (security unchanged)
- Add TypeHint node type in parser for //- @TypeOf(field): type syntax
- Support scalar types (f32, i32, bool, etc.) and array/struct types
- Use helpers.appendValue() for non-string typed fields
- Filter out loop variable references from Data struct fields
- Preserve @TypeOf comments during comment stripping
Example usage:
//- @TypeOf(subtotal): f32
span $#{subtotal}
//- @TypeOf(items): []{name: []const u8, price: f32}
each item in items
h3 #{item.name}
- Add std.log.scoped(.pugz) to template.zig and view_engine.zig
- Log detailed error info (code, line, column, message) when parsing fails
- Log template path context in ViewEngine on parse errors
- Remove debug print from lexer, use proper scoped logging instead
- Move benchmarks, docs, examples, playground, tests out of src/ to project root
- Update build.zig and documentation paths accordingly
- Bump version to 0.3.1
- ViewEngine now supports extends and named blocks
- Each route gets exclusive cached AST (no shared parent layouts)
- Fix iteration over struct arrays in each loops
- Add demo app with full e-commerce layout using extends
- Serve static files from public folder
- Bump version to 0.3.0
- Added comprehensive module-level documentation explaining architecture
- Added doc comments to all public and key internal functions
- Improved inline comments focusing on 'why' not 'what'
- Updated CLAUDE.md with code comments rule
- Bump version to 0.2.0
When a mixin calls another mixin passing a variable with the same name
as the parameter (e.g., +alert(message) where alert has param message),
skip generating redundant const declaration since the variable is already
in scope.
Also adds missing alert.pug mixin for demo project.
- Add scoped logger (pugz/runtime) for better log filtering
- Add warnings when mixin not found
- Add warnings for mixin attribute failures
- Add warnings for mixin directory/file lookup failures
- Add warnings for mixin parse/tokenize failures
- Use 'action first, then reason' pattern in all log messages