1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-27 01:24:40 +01:00
liquid/render/config.go
2017-07-04 16:48:38 -04:00

28 lines
637 B
Go

package render
import "github.com/osteele/liquid/expression"
// Config holds configuration information for parsing and rendering.
type Config struct {
// ExpressionConfig expression.Config
expression.Config
Filename string
tags map[string]TagDefinition
blockDefs map[string]*blockDef
}
// NewConfig creates a new Settings.
func NewConfig() Config {
s := Config{
Config: expression.NewConfig(),
tags: map[string]TagDefinition{},
blockDefs: map[string]*blockDef{},
}
return s
}
// AddFilter adds a filter to settings.
func (s Config) AddFilter(name string, fn interface{}) {
s.Config.AddFilter(name, fn)
}