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