Documentation ¶
Index ¶
- type AssetSource
- type AssetSourceFunc
- type Box
- func (b *Box) Compile(name string) (Template, error)
- func (b *Box) Compose(name string, deps ...string) (Template, error)
- func (b *Box) Funcs(fm FuncMap) *Box
- func (b *Box) Get(name string) (Template, error)
- func (b *Box) GetOrCompose(name string, deps ...string) (Template, error)
- func (b *Box) Set(name string, t Template) error
- type FuncMap
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetSource ¶
type AssetSourceFunc ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
func New ¶
func New(assets AssetSource) *Box
func (*Box) Compile ¶
Compile compiles the template specified the given name. If the template name has a ".html" suffix, html/template is used. Otherwise text/template is assumed.
func (*Box) Compose ¶
Compose creates a template instance using the templates specified in `name` and `deps`.
func (*Box) Funcs ¶
Funcs specifies the set of template functions that will be applied to all templates that are compiled
func (*Box) Get ¶
Get returns the template associated with asset `name`. An error is returned if the template does not exist.
func (*Box) GetOrCompose ¶
GetOrCompose is like Get, except that if the template named by `name` does not exist already, it will call Compose to generate it. Otherwise this methods turns a previously cached copy.