templates

package
v0.0.0-...-5e14263 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HeaderFunctions = template.FuncMap{
	"json": func(v 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, l 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 `split` are irrevelant so not added.

Functions

func NewParse

func NewParse(tag, format string) (*template.Template, error)

NewParse creates a new tagged template with the basic functions and parses the given format.

func Parse

func Parse(format string) (*template.Template, error)

Parse creates a new anonymous template with the basic functions and parses the given format.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL