Documentation
¶
Overview ¶
Package render executes the embedded template tree over the IR, producing the complete file plan for a generated repository. Rendering is pure — []File in memory; Write materializes a plan under the regeneration-safety rules (markers, internal/custom/ emitted once).
Index ¶
Constants ¶
const Marker = "Code generated by biscuit. DO NOT EDIT."
Marker is the generated-file header line. Files whose on-disk copy lacks it are treated as user-owned and never rewritten. No biscuit version inside — golden bytes must not churn on biscuit releases.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
Path string // slash-separated, relative to the output dir
Contents []byte
Executable bool
EmitOnce bool // written when absent, never overwritten (internal/custom/)
}
type Provenance ¶
Provenance records where the spec came from, written to .biscuit-state.yml.
type WriteResult ¶
type WriteResult struct {
Written []string
SkippedCustom []string // EmitOnce files that already existed
SkippedUnmarked []string // existing files without the marker: user-owned
}
WriteResult reports what Write actually touched.
func WriteFiles ¶
func WriteFiles(dir string, files []File) (*WriteResult, error)
WriteFiles materializes a plan under dir. Regeneration touches only marked files: an existing file without the marker has been taken over by the user (or never carried one) and is left alone — except when the planned contents carry no marker either (go.sum can't hold comments; it stays machine-owned).