Created
January 2, 2014 17:06
-
-
Save onionhammer/8222475 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import templates, macros | |
template master(content: stmt): stmt {.immediate.} = | |
template body = content | |
tmpli html""" | |
<html> | |
<body> | |
${ body() } | |
</body> | |
</html> | |
""" | |
proc body(items = 5): string = | |
master: tmpl html""" | |
<ul> | |
$for i in 0.. items { | |
<li>this is my content! $i</li> | |
} | |
</ul> | |
""" | |
when isMainModule: | |
echo body(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment