Documentation
¶
Overview ¶
Example ¶
// Set up variables and template.
vars := map[string]interface{}{"Name": " John Jacob Jingleheimer Schmidt "}
tpl := `Hello {{.Name | trim | lower}}`
// Get the Thixo function map.
fmap := TxtFuncMap()
t := template.Must(template.New("test").Funcs(fmap).Parse(tpl))
err := t.Execute(os.Stdout, vars)
if err != nil {
fmt.Printf("Error during template execution: %s", err)
return
}
Output: Hello john jacob jingleheimer schmidt
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FuncMap ¶
FuncMap produces the function map.
Use this to pass the functions into the template engine:
tpl := template.New("foo").Funcs(thixo.FuncMap()))
func GenericFuncMap ¶
func GenericFuncMap() map[string]interface{}
GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.
func HermeticHtmlFuncMap ¶
HermeticHtmlFuncMap returns an 'html/template'.Funcmap with only repeatable functions.
func HermeticTxtFuncMap ¶
HermeticTxtFuncMap returns a 'text/template'.FuncMap with only repeatable functions.
func HtmlFuncMap ¶
HtmlFuncMap returns an 'html/template'.Funcmap.
Types ¶
type DSAKeyFormat ¶
DSAKeyFormat stores the format for DSA keys. Used by pemBlockForKey.
Click to show internal directories.
Click to hide internal directories.