Documentation
¶
Overview ¶
Package render implements the `aiwf render` verb (per-verb subpackage of M-0116; includes the Resolver moved from render_resolver.go).
Index ¶
- func NewCmd() *cobra.Command
- func PluralToEntityKind(plural string) (entity.Kind, bool)
- func RunRoadmap(root string, write bool, actor string) int
- func RunSite(root, format, out, scope string, noHistory, pretty bool) int
- func TitleForKindIndex(plural string, includeArchived bool) string
- type Resolver
- func (r *Resolver) EntityData(id string) (*htmlrender.EntityData, error)
- func (r *Resolver) EpicData(id string) (*htmlrender.EpicData, error)
- func (r *Resolver) IndexData() (*htmlrender.IndexData, error)
- func (r *Resolver) KindIndexData(plural string, includeArchived bool) (*htmlrender.KindIndexData, error)
- func (r *Resolver) MilestoneData(id string) (*htmlrender.MilestoneData, error)
- func (r *Resolver) StatusData() (*htmlrender.StatusData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmd ¶
NewCmd builds `aiwf render`. Two surfaces:
- `aiwf render roadmap [--write]` → markdown roadmap.
- `aiwf render --format=html [...]` → static-site HTML render.
Roadmap is a Cobra subcommand; html mode is the parent's RunE (matches the existing public CLI shape rather than introducing a new `render html` subverb that would break consumer scripts).
func PluralToEntityKind ¶
PluralToEntityKind mirrors the htmlrender package's mapping (which is package-private). Kept in lockstep here so the cmd-side resolver doesn't import unexported helpers; the closed set is small and stable.
func RunRoadmap ¶
RunRoadmap executes `aiwf render roadmap`. Returns one of the cliutil.Exit* codes.
func RunSite ¶
RunSite handles `aiwf render --format=html [--out <dir>] [--scope <id>] [--no-history] [--pretty]`. Read-only — produces a directory of HTML files. No commit. Always emits the standard JSON envelope on stdout per I3 plan §5; --pretty toggles indent.
Result payload:
{ "result": { "out_dir": "<abs>", "files_written": N, "elapsed_ms": M } }
RunSite executes `aiwf render --format=html`. Returns one of the cliutil.Exit* codes.
func TitleForKindIndex ¶
TitleForKindIndex returns the page title for a per-kind index. Format: "Gaps" (active) / "All gaps" (all-set). Mirrors the htmlrender package's private TitleForKindIndex.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements htmlrender.PageDataResolver against a loaded planning tree plus git access. It pulls per-entity body sections from disk, walks `aiwf history` per entity for the commits / build / tests / provenance tabs, and reads the scope FSM for the scopes table.
One resolver instance per render — internal caches live for the duration of the call. History results are cached per id so the epic page (recent activity) and milestone page (commits + build + tests + provenance) don't read git twice for the same entity.
func NewRenderResolver ¶
func NewRenderResolver(ctx context.Context, root string, tr *tree.Tree, cfg *config.Config, findings []check.Finding) *Resolver
NewRenderResolver builds a resolver bound to a single render invocation. cfg may be nil (the consumer's aiwf.yaml might be missing); the resolver treats nil as "default settings."
func (*Resolver) EntityData ¶
func (r *Resolver) EntityData(id string) (*htmlrender.EntityData, error)
EntityData implements htmlrender.PageDataResolver for the four kinds with no specialized template (gap, ADR, decision, contract). Reads the body from disk and parses sections in document order so the page reads as a recognizable rendering of the source markdown. G35 fix.
func (*Resolver) EpicData ¶
func (r *Resolver) EpicData(id string) (*htmlrender.EpicData, error)
EpicData implements htmlrender.PageDataResolver.
func (*Resolver) IndexData ¶
func (r *Resolver) IndexData() (*htmlrender.IndexData, error)
IndexData implements htmlrender.PageDataResolver.
Active-default per M-0087/AC-6: epics whose path lives under work/epics/archive/ are filtered out of the home page rollup; the full set lives on epics-all.html. KindIndexLinks populates the "Browse by kind" nav block on the home page.
func (*Resolver) KindIndexData ¶
func (r *Resolver) KindIndexData(plural string, includeArchived bool) (*htmlrender.KindIndexData, error)
KindIndexData implements htmlrender.PageDataResolver. Per-kind index payload for the active-default and all-set pages. M-0087/ AC-6 + AC-7.
func (*Resolver) MilestoneData ¶
func (r *Resolver) MilestoneData(id string) (*htmlrender.MilestoneData, error)
MilestoneData implements htmlrender.PageDataResolver.
func (*Resolver) StatusData ¶
func (r *Resolver) StatusData() (*htmlrender.StatusData, error)
StatusData implements htmlrender.PageDataResolver. Reuses the existing status.BuildStatus() + status.ReadRecentActivity() helpers (which power the `aiwf status` verb) and projects the result into the renderer-facing types.