Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine wraps text/template with hierarchical resolution and custom functions.
func New ¶
New creates a template engine with hierarchical resolution. localDir is the project-local template directory (e.g. ".lore/templates"). globalDir is the user-global template directory (e.g. "~/.config/lore/templates").
func (*Engine) Render ¶
func (e *Engine) Render(name string, data TemplateContext) (string, error)
Render resolves a named template via the hierarchy and executes it with the given data.
func (*Engine) TemplateExists ¶
TemplateExists checks whether a template with the given name is available in any level of the hierarchy (local, global, or embedded defaults).
type TemplateContext ¶
type TemplateContext struct {
Type string
Title string
Date string // YYYY-MM-DD
Commit string
Author string
Branch string // current branch at capture time
Scope string // scope from conventional commit
Tags []string
Why string
Impact string
Alternatives string
GeneratedBy string // "hook" or "manual"
AngelaMode string
}
TemplateContext holds all variables passed to templates during rendering. Built by the caller (workflow/ or cmd/) from domain.GenerateInput and domain.DocMeta. The template package never constructs TemplateContext itself.