Documentation ¶
Index ¶
- func BuiltInFuncs() template.FuncMap
- func Populate(t TextTemplate) (string, error)
- func PopulateFrom(t Template, path string) (string, error)
- func TrimTemplate(s string) string
- func Write(t TextTemplate, path string) error
- func WriteFrom(t Template, srcPath string, dstPath string) error
- type CustomDelimiters
- type CustomFunctions
- type Template
- type TextTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltInFuncs ¶
func Populate ¶
func Populate(t TextTemplate) (string, error)
Populate populates the template and returns it as a string.
func PopulateFrom ¶
PopulateFrom reads the template from a given path and returns the populated template as a string.
func TrimTemplate ¶
TrimTemplate trims alls leading and trailing spaces from each line and replace tabs with double space.
func Write ¶
func Write(t TextTemplate, path string) error
Write populates the template and writes it to the given path.
Types ¶
type CustomDelimiters ¶
If a type implements the Delimiters method, it can specify custom delimiters that will replace the default ones.
type CustomFunctions ¶
If a type implements the Functions method, it can provide custom functions that will be added to the existing built-in functions.
type TextTemplate ¶
Click to show internal directories.
Click to hide internal directories.