1 // A jinja like template-engine 2 // 3 // Blog posts about gonja (including introduction and migration): 4 // https://www.florian-schlachter.de/?tag=gonja 5 // 6 // Complete documentation on the template language: 7 // https://docs.djangoproject.com/en/dev/topics/templates/ 8 // 9 // Try out gonja live in the gonja playground: 10 // https://www.florian-schlachter.de/gonja/ 11 // 12 // Make sure to read README.md in the repository as well. 13 // 14 // A tiny example with template strings: 15 // 16 // (Snippet on playground: https://www.florian-schlachter.de/gonja/?id=1206546277) 17 // 18 // // Compile the template first (i. e. creating the AST) 19 // tpl, err := gonja.FromString("Hello {{ name|capfirst }}!") 20 // if err != nil { 21 // panic(err) 22 // } 23 // // Now you can render the template with the given 24 // // gonja.Context how often you want to. 25 // out, err := tpl.Execute(gonja.Context{"name": "fred"}) 26 // if err != nil { 27 // panic(err) 28 // } 29 // fmt.Println(out) // Output: Hello Fred! 30 // 31 package gonja 32