Documentation
¶
Overview ¶
Package Lemur is a theme templating tool.
Index ¶
Constants ¶
const ( ErrThemesBaseDir = Error("lemur: error the supplied theme directory no themes found") ErrTemplateDir = Error("lemur: error with supplied template directory") )
Errors returned by the api.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lemur ¶
type Lemur struct {
// contains filtered or unexported fields
}
func (*Lemur) Render ¶
Render executes the specified template by name, writing the output to the provided io.Writer.
tmplName specifies which named layout set to use (e.g., "_defaults", "mytemplate"). If tmplName is an empty string, it defaults to "_defaults". The method will then execute the "_index.html.tmpl" template within that layout set.
data is the data to be passed to the template for rendering.
This is the primary method for rendering templates when you have an output stream, such as an http.ResponseWriter or a file.
func (*Lemur) Srender ¶
Srender renders the specified template by name with the given data and returns the output as a string.
It is a convenience wrapper around the Render method. Use Srender when you need the template output as a string, for example, to pass to another function, store in a variable, or when an io.Writer is not readily available. If direct writing to an output stream (like an http.ResponseWriter) is possible, using Render directly might be more efficient as it avoids the intermediate string allocation.
type Theme ¶
type Theme struct {
ThemeMetaData
// contains filtered or unexported fields
}