Skip to content

karitham/zemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zemplate

Zemplate is a WIP zig templating engine.

The syntax is inspired by text/template from go.

Examples

Identifiers

{{.foo}}

Pulls foo from struct and inserts it into the template.

if foo is { "foo": "bar" } the output would be

bar

It also works with nested identifiers, {{.foo.bar}} with { "foo": { "bar": "baz" } } would output baz.

Ranges

{{ range .foo }}- {{ .bar }}
{{ end }}

if foo is {"foo": [{ "bar": "a" }, { "bar": "b" }, { "bar": "c" }]} then the output would be

- a
- b
- c

Conditionals

{{ if .foo }}{{ .bar }}{{ end }}

if foo is {"foo": true, "bar": "hello world!"} then the output would be

hello world!

Notes

I'm open to any and all contributions, be it from code-review, documentation or any form of critique, especially since this is my first zig project.

About

Zemplate is a zig templating engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages