Files
mgmt/lang/interpret_test/TestAstFunc2/template-0/main.mcl
James Shubin f716a3a73b lang: funcs: Rename template functions to remove periods
Due to a limitation in the template library, we need to rename some
functions. It's probably worth looking into modifying this library or
finding an alternate version.
2019-02-01 03:58:02 -05:00

13 lines
389 B
Plaintext

import "datetime"
$secplus42 = 42 + $ayear
# note the order of the assignment (year can come later in the code)
$ayear = 60 * 60 * 24 * 365 # is a year in seconds (31536000)
$tmplvalues = struct{time => $secplus42, hello => "world",}
print "template-0" {
msg => template("Hello: {{ .hello }}, 42 sec + 1 year is: {{ .time }} seconds, aka: {{ datetime_print .time }}", $tmplvalues),
}