Skip to content

silversquirl/zig-mustache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Zig Mustache

Mustache templates at comptime!

Usage

// Render an inline template to an allocated []u8
const result = try mustache.render(allocator,
	\\Hello, {{name}}!
	\\You have {{messages.len}} new messages:
	\\{{#messages}}
	\\ - {{subject}}
	\\{{/messages}}
	\\{{^messages}}
	\\   {{! no messages, how sad }}
	\\   Nothing here :(
	\\{{/messages}}
, template_data);

// Render a template stored in a file to stdout
try mustache.renderTo(
	@embedFile("template.mustache"),
	template_data,
	std.io.getStdOut().writer()
);

About

Mustache templates at comptime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages