nimja icon indicating copy to clipboard operation
nimja copied to clipboard

typed and compiled template engine inspired by jinja2, twig and onionhammer/nim-templates for Nim.

Results 19 nimja issues
Sort by recently updated
recently updated
newest added

Is it possible to compile these templates at runtime? with a function or something?

enhancement
help wanted

the string escaping rules seems to be broken, test these and report errors here.

``` {% let cleaned = path.replace("public", "").replace("\\", "/") %} C:\Users\david\projects\nimja\src\nimja\parser.nim(343, 11) Error: Cannot parse eval body: let cleaned = path.replace("public", "").replace("\", "/") ```

bug

Const variables can be optimized if they're touching a string block, saving an add call

Optimization

`apply` should behave like a proc call with a block of code ``` {% filter upper %} This text becomes uppercase {% endfilter %} ```

enhancement

The current file watcher implementation is quite basic and needs polling. Use a real file watcher if available.

enhancement

https://forum.nim-lang.org/t/8386 and https://github.com/nim-lang/Nim/issues/18780

when curdir is: `C:\Users\david\projects\nimja` then this is valid: ``` {% importnwt ../../tests/templates/blockMasterWithContent.html %} {% extends ./tests/templates/blockMasterWithContent.html %}{% block title %}one{%endblock%}{%block mybody%}two{%endblock%} ``` tested from dynamicAgain branch.

bug

when the error is in a template string, an extra "filename" argument could be passed to the `compileTemplateStr()` to know which template string has the error

enhancement