Documentation
¶
Index ¶
- type AstTransformer
- type Context
- type Executor
- type GoTemplateCallback
- func (t *GoTemplateCallback) BeforeExec(ctx context.Context, tmpl texttemplate.Preparer)
- func (t *GoTemplateCallback) GetFunc(ctx context.Context, tmpl texttemplate.Preparer, name string) (fn reflect.Value, firstArg reflect.Value, found bool)
- func (t *GoTemplateCallback) GetMapValue(ctx context.Context, tmpl texttemplate.Preparer, receiver, key reflect.Value) (reflect.Value, bool)
- func (t *GoTemplateCallback) GetMethod(ctx context.Context, tmpl texttemplate.Preparer, receiver reflect.Value, ...) (method reflect.Value, firstArg reflect.Value)
- func (t *GoTemplateCallback) OnCalled(ctx context.Context, tmpl texttemplate.Preparer, name string, ...)
- type Lookup
- type Namespace
- type Parser
- func (t *Parser) MarkReady() error
- func (t *Parser) Parse(info valueobject.TemplateInfo) (*valueobject.State, error)
- func (t *Parser) ParseOverlap(overlay, base valueobject.TemplateInfo) (*valueobject.State, bool, error)
- func (t *Parser) ParseWithLock(name, tpl string) (template.Preparer, error)
- func (t *Parser) Transform(ns *Namespace, ts *valueobject.State) error
- type Shortcode
- type Template
- func (t *Template) Execute(ctx context.Context, name string, data any) (tmpl string, res any, err error)
- func (t *Template) LoadEmbedded() error
- func (t *Template) LoadTemplates() error
- func (t *Template) LookupLayout(names []string) (template.Preparer, bool, error)
- func (t *Template) MarkReady() error
- func (t *Template) Parse(name, tpl string) (template.Preparer, error)
- func (t *Template) PostTransform() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AstTransformer ¶
type AstTransformer struct {
// Holds name and source of template definitions not found during the first
// AST transformation pass.
TransformNotFound map[string]*valueobject.State
}
type Context ¶
func ApplyTemplateTransformers ¶
func ApplyTemplateTransformers(t *valueobject.State, lookupFn func(name string) *valueobject.State) (*Context, error)
type Executor ¶
type Executor struct {
texttemplate.Executor
}
type GoTemplateCallback ¶
func (*GoTemplateCallback) BeforeExec ¶
func (t *GoTemplateCallback) BeforeExec(ctx context.Context, tmpl texttemplate.Preparer)
func (*GoTemplateCallback) GetMapValue ¶
func (t *GoTemplateCallback) GetMapValue(ctx context.Context, tmpl texttemplate.Preparer, receiver, key reflect.Value) (reflect.Value, bool)
type Namespace ¶
type Namespace struct {
*valueobject.StateMap
}
type Parser ¶
type Parser struct {
PrototypeText *texttemplate.Template
PrototypeHTML *htmltemplate.Template
Ast *AstTransformer
*sync.RWMutex
// contains filtered or unexported fields
}
func (*Parser) Parse ¶
func (t *Parser) Parse(info valueobject.TemplateInfo) (*valueobject.State, error)
func (*Parser) ParseOverlap ¶
func (t *Parser) ParseOverlap(overlay, base valueobject.TemplateInfo) (*valueobject.State, bool, error)
func (*Parser) ParseWithLock ¶
type Shortcode ¶
type Shortcode struct {
// contains filtered or unexported fields
}
func (*Shortcode) LookupVariant ¶
type Template ¶
type Template struct {
*Executor
*Lookup
Parser *Parser
Main *Namespace
Fs template.Fs
*Shortcode
Log loggers.Logger
LayoutTemplateCache map[string]valueobject.LayoutCacheEntry
// contains filtered or unexported fields
}
func (*Template) LoadEmbedded ¶
func (*Template) LoadTemplates ¶
func (*Template) LookupLayout ¶
func (*Template) PostTransform ¶
Click to show internal directories.
Click to hide internal directories.