Documentation
¶
Overview ¶
The templating system for gonew (v2).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
An artificial wrapper struct to make template rendering less cumbersome.
func (Environment) RenderText ¶
Render a raw template string using the templates/functions of ts.
func (Environment) RenderTextAsString ¶
func (env Environment) RenderTextAsString(ts Interface, prefix, text string) (string, error)
Like Environment.RenderText, but returns a string containing rendered content.
type ErrNoTemplate ¶
type ErrNoTemplate string
func (ErrNoTemplate) Error ¶
func (err ErrNoTemplate) Error() string
type ErrSourceType ¶
type ErrSourceType struct {
// contains filtered or unexported fields
}
func (ErrSourceType) Error ¶
func (err ErrSourceType) Error() string
type Interface ¶
type Interface interface { Render(io.Writer, string, interface{}) error // Render a named template. Source(interface{}) error // Add a template source. Funcs(template.FuncMap) error // Add a set of functions. }
A set of templates relatively in-line with template.Template.
type SourceDirectory ¶
type SourceDirectory string
type SourceFile ¶
type SourceFile string
type SourceTemplate ¶
type SourceTemplate struct{ Name, Text string }
Click to show internal directories.
Click to hide internal directories.