Documentation
¶
Overview ¶
Package render runs the templates of every generator and puts their output together into files.
Index ¶
Constants ¶
const (
// Dir is the folder of a set's FS that holds its templates.
Dir = "templates"
)
Variables ¶
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine holds every template of a run. An override is a template apart from the others: one that could run the template that asks for it would never end.
func New ¶
New loads the templates of every set, then the block overrides. An override of a block no set declares, or one that does not parse, is a config error.
func (*Engine) RenderFile ¶
RenderFile puts a file together and formats it when the options ask for that. Each part with text goes on lines of its own below a blank line, so that none runs into the one before it.
type FileData ¶
FileData is what a generated file holds around its parts. Header is plain text; Imports is the import declaration; Guard is the runtime constant the file refers to, if any. Parts holds the declarations of each part, with or without line breaks around them.
type Options ¶
Options are what the engine reads of a config. Templates and Format mirror its keys. Needs says, for each block of a part the config does not write, what the config has to set.