templates

package
v0.6.7-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: BSD-3-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGolangHelpers added in v0.3.0

func AddGolangHelpers(t *template.Template) *template.Template

func Helper_add

func Helper_add(lhs, rhs int) int

func Helper_builtin

func Helper_builtin(str string) interface{}

func Helper_camel

func Helper_camel(value string) string

func Helper_camelT

func Helper_camelT(value string) string

func Helper_concat added in v0.6.1

func Helper_concat(ss ...string) string

func Helper_contains

func Helper_contains(str, srch string) string

func Helper_dict added in v0.6.3

func Helper_dict(values ...interface{}) (map[string]interface{}, error)

func Helper_file added in v0.2.8

func Helper_file(filename string) string

func Helper_getbetween

func Helper_getbetween(str, lhs, rhs string) string

func Helper_getprefix

func Helper_getprefix(str, suf string) string

func Helper_getsuffix

func Helper_getsuffix(str, suf string) string

func Helper_gokind

func Helper_gokind(input interface{}) string

func Helper_hasprefix

func Helper_hasprefix(str, pre string) string

func Helper_hassuffix

func Helper_hassuffix(str, suf string) string

func Helper_identity

func Helper_identity(thing interface{}) interface{}

func Helper_inc

func Helper_inc(val int) int

func Helper_indent

func Helper_indent(value, indent string) string

func Helper_join added in v0.6.1

func Helper_join(sep string, ss ...string) string

func Helper_json

func Helper_json(value interface{}) string

func Helper_jsoninline added in v0.3.2

func Helper_jsoninline(value interface{}) string

jsonl too?

func Helper_kebab

func Helper_kebab(value string) string

func Helper_kebabU

func Helper_kebabU(value string) string

func Helper_lookup added in v0.6.4

func Helper_lookup(path string, data interface{}) interface{}

func Helper_lower

func Helper_lower(value string) string

func Helper_pascal added in v0.6.3

func Helper_pascal(value string) string

func Helper_pretty

func Helper_pretty(value interface{}) string

func Helper_replace

func Helper_replace(str, old, new string, cnt int) string

func Helper_snake

func Helper_snake(value string) string

func Helper_snakeU

func Helper_snakeU(value string) string

func Helper_split

func Helper_split(str, sep string) []string

func Helper_substr

func Helper_substr(str string, start, end int) string

func Helper_title

func Helper_title(value string) string

func Helper_toml

func Helper_toml(value interface{}) string

func Helper_trimfrom_first

func Helper_trimfrom_first(str, pre string, keep bool) string

func Helper_trimfrom_last

func Helper_trimfrom_last(str, pre string, keep bool) string

func Helper_trimprefix

func Helper_trimprefix(str, pre string) string

func Helper_trimspace added in v0.6.3

func Helper_trimspace(str string) string

func Helper_trimsuffix

func Helper_trimsuffix(str, suf string) string

func Helper_trimto_first

func Helper_trimto_first(str, pre string, keep bool) string

func Helper_trimto_last

func Helper_trimto_last(str, pre string, keep bool) string

func Helper_upper

func Helper_upper(value string) string

func Helper_xml

func Helper_xml(value interface{}) string

func Helper_yaml

func Helper_yaml(value interface{}) string

Types

type Delims added in v0.6.0

type Delims struct {
	LHS string
	RHS string
}

type Template

type Template struct {
	// Original inputs
	Name   string
	Source string
	Delims *Delims

	// golang
	T *template.Template
}

func CreateFromString added in v0.2.9

func CreateFromString(name, content string, delims *Delims) (t *Template, err error)

Creates a hof Template struct, initializing the correct template system. The system will be inferred if left empty

func NewTemplate

func NewTemplate() *Template

func (*Template) Render

func (T *Template) Render(data interface{}) ([]byte, error)

type TemplateMap

type TemplateMap map[string]*Template

func CreateTemplateMapFromFolder

func CreateTemplateMapFromFolder(glob, prefix string, delims *Delims) (tplMap TemplateMap, err error)

func NewTemplateMap

func NewTemplateMap() TemplateMap

func (TemplateMap) ImportFromFolder

func (M TemplateMap) ImportFromFolder(glob, prefix string, delims *Delims) error

func (TemplateMap) ImportTemplateFile

func (M TemplateMap) ImportTemplateFile(filename string, delims *Delims) error

Jump to

Keyboard shortcuts

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