2017-07-04 17:08:57 +02:00
|
|
|
package render
|
|
|
|
|
2017-07-07 11:41:37 +02:00
|
|
|
import (
|
|
|
|
"github.com/osteele/liquid/parser"
|
|
|
|
)
|
2017-07-04 17:08:57 +02:00
|
|
|
|
|
|
|
// Config holds configuration information for parsing and rendering.
|
|
|
|
type Config struct {
|
2017-07-07 11:41:37 +02:00
|
|
|
parser.Config
|
2017-07-10 18:23:46 +02:00
|
|
|
grammar
|
2020-11-03 01:36:02 +01:00
|
|
|
Cache map[string][]byte
|
2017-07-10 18:23:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type grammar struct {
|
2017-07-06 15:38:18 +02:00
|
|
|
tags map[string]TagCompiler
|
|
|
|
blockDefs map[string]*blockSyntax
|
2017-07-04 17:08:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewConfig creates a new Settings.
|
|
|
|
func NewConfig() Config {
|
2017-07-10 18:23:46 +02:00
|
|
|
g := grammar{
|
2017-07-06 15:38:18 +02:00
|
|
|
tags: map[string]TagCompiler{},
|
|
|
|
blockDefs: map[string]*blockSyntax{},
|
2017-07-04 17:08:57 +02:00
|
|
|
}
|
2020-11-03 01:36:02 +01:00
|
|
|
return Config{Config: parser.NewConfig(g), grammar: g, Cache: map[string][]byte{}}
|
2017-07-04 17:08:57 +02:00
|
|
|
}
|