github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/flosch/pongo2.v3/doc.go (about)

     1  // A Django-syntax like template-engine
     2  //
     3  // Blog posts about pongo2 (including introduction and migration):
     4  // https://www.florian-schlachter.de/?tag=pongo2
     5  //
     6  // Complete documentation on the template language:
     7  // https://docs.djangoproject.com/en/dev/topics/templates/
     8  //
     9  // Try out pongo2 live in the pongo2 playground:
    10  // https://www.florian-schlachter.de/pongo2/
    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/pongo2/?id=1206546277)
    17  //
    18  //     // Compile the template first (i. e. creating the AST)
    19  //     tpl, err := pongo2.FromString("Hello {{ name|capfirst }}!")
    20  //     if err != nil {
    21  //         panic(err)
    22  //     }
    23  //     // Now you can render the template with the given
    24  //     // pongo2.Context how often you want to.
    25  //     out, err := tpl.Execute(pongo2.Context{"name": "fred"})
    26  //     if err != nil {
    27  //         panic(err)
    28  //     }
    29  //     fmt.Println(out) // Output: Hello Fred!
    30  //
    31  package pongo2