Documentation
¶
Overview ¶
Package run provide the logic for generating code for the gentmpl tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { // Do not cache the templates. // A new template will be created on every page.Execute. NoCache bool // Do not format the generated code with go/format. NoGoFormat bool // Package name used in the generated code. PackageName string // Asset manager to use. Possible values: // - none (default) // - go-bindata AssetManager types.AssetManager // Use text/template instead of html/template. TextTemplate bool // Name of the template.FuncMap variable used in template creation. // The variable must be defined in another file of the same package // (ex: "templates/func-map.go"). // If empty, no funcMap will be used. FuncMap string // Name of the PageEnum type definition. PageEnumType string // Strings used as prefix and suffix in the PageEnum constants. // Example: page "CreateUser", prefix="Page", suffix="" -> PageCreateUser PageEnumPrefix string PageEnumSuffix string // Name of the TemplateEnum type definition. TemplateEnumType string // Base folder of the templates files. TemplateBaseDir string // Mapping from template name to items used to create the template. // Each item can be a: // - file path to parse in the template creation. // - name of another template to include in the current template. Templates map[string][]string `toml:"templates"` // Mapping from page name to template name and base values used to render // the page. Pages map[string]struct { Template string Base string } }
Context contains the parameters that manage the code generation.
The default values of the struct are so that no NewContext() func is needed to initialize the struct.
func (*Context) WriteConfig ¶
WriteConfig prints the current Context to writer using a TOML file format. The file has comments describing each parameter of the configuration.
Directories
¶
Path | Synopsis |
---|---|
Package collection implements collection types as UniqueStrings
|
Package collection implements collection types as UniqueStrings |
Package lib implements some library functions used by gentmpl utility.
|
Package lib implements some library functions used by gentmpl utility. |
Package types implements types used in the gentmpl utility
|
Package types implements types used in the gentmpl utility |
Click to show internal directories.
Click to hide internal directories.