package templates
import "github.com/docker/cli/templates"
Index ¶
- Variables
- func New(tag string) *template.Template
- func NewParse(tag, format string) (*template.Template, error)
- func Parse(format string) (*template.Template, error)
Variables ¶
var HeaderFunctions = template.FuncMap{ "json": func(v string) string { return v }, "split": func(v string, _ string) string { return v }, "join": func(v string, _ string) string { return v }, "title": func(v string) string { return v }, "lower": func(v string) string { return v }, "upper": func(v string) string { return v }, "truncate": func(v string, _ int) string { return v }, }
HeaderFunctions are used to created headers of a table. This is a replacement of basicFunctions for header generation because we want the header to remain intact. Some functions like `pad` are not overridden (to preserve alignment with the columns).
Functions ¶
func New ¶
New creates a new empty template with the provided tag and built-in template functions.
func NewParse ¶
NewParse creates a new tagged template with the basic functions and parses the given format.
func Parse ¶
Parse creates a new anonymous template with the basic functions and parses the given format.
Source Files ¶
- Version
- v28.1.1+incompatible (latest)
- Published
- Apr 18, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 2 hours ago –
Tools for package owners.