gonja
gonja copied to clipboard
Jinja-like syntax template-engine for Go
``` func TestJinja(t *testing.T) { jsonStr := `{"search": "yeno"}` c := map[string]interface{}{} err := json.Unmarshal([]byte(jsonStr), &c) if err != nil { fmt.Println(err.Error()) t.FailNow() } tmpl := ` {%- set keywords...
Anyone seeing this, feel free to head to https://github.com/NikolaLohinski/gonja. Happy to take any PR. I am actively maintaining it because I need it in https://github.com/NikolaLohinski/terraform-provider-jinja.
The following file isn't parsable: ```jinja {%- raw -%} 123 {%- endraw -%} ``` The parser gives this error: > Unable to parse statement "raw": Unexpected EOF, expected tag endraw....
Very simple cobra CLI... Lemme know what you think. https://gitlab.com/qnib-golang/gonja-cli
Is there a gonja CLI I can use. Just asking before potentially writing it myself.
I want to get all variable from template file, is that any method?
The README.md is still very much based on pongo2. Especially the supported Jinja2 features, which differ from Django templates should be better highlighted, e.g.: * Supported filter syntax: e.g. `{{...
In this example, **merge_all** function will be defined to receive args and kwargs arguments. ```go tpl, _ := gonja.FromString("{{merge_all('jack', 'jill', 'jimmy', went='up-the-hill')}}") if data, e := tpl.Execute(gonja.Context{ "merge_all": func(name *exec.VarArgs)...