warning: This library is still in development.
nimtemple is a template engine by pure Nim implementation.
Syntax is Jinja and Go template like.
{{ $varname }}
{{ if $boolvar }}
TRUE!
{{ else }}
FALSE!
{{ end }}
{{ for elem in $seqvar }}
<li>{{ $elem }}</li>
{{ end }}
{{ - if $boolvar }}
DO IT
{{ end }}
<!-- extends.html -->
{{ extends "parent.html" }}
{{ define title }}
ZUNDA
{{ end }}
<!-- parent.html -->
<title>{{ - define title }}{{ end }}</title>
<!-- output => -->
<title>ZUNDA</title>
{{ include "header.html" }}
{{ default($wtf, "DEFALUT!") }}
nimble install https://github.com/snowlt23/nimtemple
var tmpl = initTempleRenderer()
tmpl["persons"] = %* ["Yukari", "Maki", "Akane", "Aoi"]
echo tmpl.renderFile("for.html")