Documentation
¶
Index ¶
Constants ¶
const IDMarkdown = "markdown"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.82.1
type Option func(*config)
Option configures a TemplateRenderer.
func WithTemplateDir ¶ added in v0.82.1
WithTemplateDir loads templates from a filesystem directory instead of the embedded defaults. The directory should contain *.tmpl files whose {{define}} names match the default set: proposal, batchOperation, call, parameter, annotations.
func WithTemplateFuncs ¶ added in v0.82.1
WithTemplateFuncs adds extra template functions to the renderer's func map. These are merged with the built-in functions; caller-provided functions take precedence over built-ins if keys collide.
func WithTemplates ¶ added in v0.82.1
WithTemplates provides in-memory template overrides keyed by any name. Each value must contain a valid {{define "name"}} block -- the key itself is used only as a template set label and does not need to match the define name. Useful for testing or programmatic template generation.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages renderer registration and lookup
type RenderRequest ¶
RenderRequest encapsulates the domain and environment name
type Renderer ¶
type Renderer interface {
ID() string
RenderTo(w io.Writer, req RenderRequest, proposal analyzer.AnalyzedProposal) error
}
Renderer transforms an AnalyzedProposal into a specific output format
type TemplateRenderer ¶ added in v0.82.1
type TemplateRenderer struct {
// contains filtered or unexported fields
}
TemplateRenderer renders an AnalyzedProposal using Go text/template.
func NewMarkdownRenderer ¶ added in v0.82.1
func NewMarkdownRenderer(opts ...Option) (*TemplateRenderer, error)
NewMarkdownRenderer creates a TemplateRenderer with embedded markdown templates.
func (*TemplateRenderer) ID ¶ added in v0.82.1
func (r *TemplateRenderer) ID() string
func (*TemplateRenderer) RenderTo ¶ added in v0.82.1
func (r *TemplateRenderer) RenderTo(w io.Writer, req RenderRequest, proposal analyzer.AnalyzedProposal) error