HofGeneratorFile



HofGeneratorFile is the schema for a generated file. The generator Out field is a list of these and what hof iterates over and processes.


Source on GitHub

file.cue

package gen


// A file which should be generated by hof
#HofGeneratorFile: {
	// The local input data
	In: { ... }

	// The full path under the output location
	// empty implies don't generate, even though it may endup in the list
	Filepath: string | *""

	// The template contents
	Template: string | *""

	// Relative name from TemplatesDir
	TemplateName: string | *""

	// Include Common attributes
	//  '.' will bre replaced by generator defaults

	TemplateConfig?: #TemplateConfigReplacible

	// WARNING, intentionally closed to prevent developer error when creating GenFiles
}

Creator Fields

#HofGeneratorFile is only for generator creators.

In

The input data used when rendering the template.

Filepath

The full filepath within the outdir to generate.

Template, TemplateName

You must specify one or the other. Template is content whereas TemplateName references one of the predefined templates.

TemplateConfig

The configuration for this template. Defaults to the configuration defined in the generator. Typically only needed when you need alternative delimitors.

2021 Hofstadter, Inc