README ¶
views
v := views.New(views.Config{
Dir: "./examples",
Extensions: []string{".tmpl"},
Compress: true,
Dev: false,
VersionFilePatch: "./examples/version.txt",
VersionSize: 12,
Log: func(str string) {
log.Println(str)
},
})
if err := v.Load(); err != nil {
log.Fatalln("views load", err)
}
if err := v.Execute(os.Stdout, "child.tmpl", nil); err != nil {
log.Fatalln("views Execute", err)
}
PASS
coverage: 79.7% of statements
ok views 0.279s
Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { //Dir specifies the path to the directory with templates Dir string //Extensions specifies what file extensions the templates have Extensions []string //Compress specifies whether to compress templates //true - compresses templates during parsing //false - does not compress templates Compress bool //Dev enable/disable development mode //true - parses templates every time //false - parses templates once at the very beginning Dev bool Log LogFunc VersionFilePatch string VersionSize int }
Click to show internal directories.
Click to hide internal directories.