Documentation
¶
Overview ¶
Package temple provides useful utilities for rendering go text/templates and html/templates with less boilerplate
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render renders the template string into a buffer and includes some useful helper functions
Example ¶
package main
import (
"fmt"
"github.com/brittonhayes/pkg/temple"
)
func main() {
// Setup a template string and
// interface for rendering
templateString := "{{.Value}}"
data := map[string]interface{}{
"Value": "foo",
}
// Render the template
output, err := temple.Render(templateString, data)
if err != nil {
return
}
// Print it out
fmt.Println(output)
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.