Documentation ¶
Overview ¶
Package emd provides support to process .md files.
Index ¶
- type Generator
- func (g *Generator) AddFileTemplate(t string) error
- func (g *Generator) AddFunc(name string, f interface{})
- func (g *Generator) AddFuncs(fm map[string]interface{})
- func (g *Generator) AddPostProcess(f func(string) string)
- func (g *Generator) AddTemplate(t string)
- func (g *Generator) Execute(out io.Writer) error
- func (g *Generator) GetData() map[string]interface{}
- func (g *Generator) GetKey(K string) interface{}
- func (g *Generator) GetOut() io.Writer
- func (g *Generator) GetSKey(K string) string
- func (g *Generator) GetTemplate() *template.Template
- func (g *Generator) SetData(name string, d interface{})
- func (g *Generator) SetDataMap(dm map[string]interface{})
- func (g *Generator) WriteString(s string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates an emd content.
func (*Generator) AddFileTemplate ¶
AddFileTemplate registers a template file.
func (*Generator) AddPostProcess ¶
AddPostProcess registers a post process function. Post process are registered by template func call and are removed after next template generation.
func (*Generator) AddTemplate ¶
AddTemplate registers a template string.
func (*Generator) GetData ¶
GetData returns a copy of the template's data. It is available only during Execute.
func (*Generator) GetTemplate ¶
GetTemplate returns the compiled templates. It is available only during Execute.
func (*Generator) SetDataMap ¶
SetDataMap registers a map of template data.
Click to show internal directories.
Click to hide internal directories.