spitz

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2015 License: MIT Imports: 10 Imported by: 2

README

spitz

go template pool with support for layouts and auto reparsing

Documentation at stathat.com/c/spitz

Status

This package was extracted from production code powering StatHat, so clearly we feel that it is production-ready, but it should still be considered experimental as other uses of it could reveal issues we aren't experiencing.

Contact us

We'd love to hear from you if you are using this in your projects! Please drop us a line: @stathat or contact us here.

About

Written by Patrick Crosby at StatHat. Twitter: @stathat

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Verbose bool

Functions

This section is empty.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func New

func New(contentDir string, reload bool) *Pool

func (*Pool) Len

func (p *Pool) Len() int

func (*Pool) Register

func (p *Pool) Register(name, leftDelim, rightDelim string) error

Register adds the template at ContentDirectory + name + .tmpl.html to the set of registered templates.

func (*Pool) RegisterLayout

func (p *Pool) RegisterLayout(name, header, footer string, leftDelim, rightDelim string) error

func (*Pool) RegisterMulti

func (p *Pool) RegisterMulti(name, leftDelim, rightDelim string, filenames ...string) error

func (*Pool) RegisterString

func (p *Pool) RegisterString(name, content string) error

func (*Pool) Render

func (p *Pool) Render(layout, name string, data interface{}, wr io.Writer) error

func (*Pool) RenderMulti

func (p *Pool) RenderMulti(layout, name, innerName string, data interface{}, wr io.Writer) error

func (*Pool) RenderNoLayout

func (p *Pool) RenderNoLayout(name string, data interface{}, wr io.Writer) error

func (*Pool) RenderNoLayoutToString

func (p *Pool) RenderNoLayoutToString(template string, data interface{}) (string, error)

func (*Pool) RenderToString

func (p *Pool) RenderToString(layout, template string, data interface{}) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL