generator

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateInput

type GenerateInput struct {
	DocType      string
	What         string
	Why          string
	Alternatives string // empty if express mode
	Impact       string // empty if express mode
	CommitInfo   *domain.CommitInfo
	GeneratedBy  string // "hook" or "manual"
	Branch       string // current branch at capture time
	Scope        string // scope from conventional commit
}

GenerateInput holds all inputs for document generation. The caller (workflow/) converts Answers + CommitInfo into this flat struct. generator/ does NOT import workflow/ or storage/ (CORRECTION C1).

func (GenerateInput) Date

func (g GenerateInput) Date() string

Date returns the commit date formatted as YYYY-MM-DD, or today if CommitInfo is nil.

type GenerateResult

type GenerateResult struct {
	Body string         // Markdown content rendered from the template
	Meta domain.DocMeta // Document metadata derived from GenerateInput
}

GenerateResult holds the rendered Markdown body and the document metadata built from the input. The caller (workflow/) passes Body + Meta to storage.WriteDoc(). Filename and Path are NOT included — those are determined by storage/ (CORRECTION C1). date is captured once inside Generate() so TemplateContext and Meta are always consistent.

func Generate

func Generate(ctx context.Context, engine *loretemplate.Engine, input GenerateInput) (GenerateResult, error)

Generate renders a document template from the given input and returns a GenerateResult containing the body and pre-built metadata. The caller is responsible for persisting the result via storage.WriteDoc() — generator/ never touches the filesystem (CORRECTION C1).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL