Closed joemarct closed 8 years ago
This may be possible to implement with staticRead; but i don't think it will work out of the box. Currently tmpli expects a string literal so that the template can be compiled into the resulting executable.
I hacked my way to achieve my end goal, which is basically to write a separate HTML file and simply pass the path to tmpli
as argument. I initiated a pull request #5 , in case you would want to merge my revisions.
Just to update on the progress of this issue: We ended up creating a separate macro tmplf
for reading HTML code from file. This has been merged to master in 84db5ce164b3512a194c54d20510806b454958e8.
I have tried to read a file and feed it to
tmpli html
, like this:tmpli html readFile "templates/base.html"
However, I got this error:
Error: field 'strVal' cannot be found