template

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, fc Factory)

Types

type Factory

type Factory func(*core.Context, TemplateSet) error

type Template

type Template interface {
	Name() string
	Execute(map[string]any) (string, error)
}

type TemplateSet

type TemplateSet interface {
	Lookup(...string) Template
	FromFile(string) (Template, error)
	FromBytes([]byte) (Template, error)
	FromString(string) (Template, error)

	Register(string, any) error
	RegisterTag(string, pongo2.TagParser) error
	RegisterFilter(string, pongo2.FilterFunction) error
	RegisterTransient(string, TransientFunction) error
}

func NewSet

func NewSet(ctx *core.Context) (TemplateSet, error)

type TransientFunction

type TransientFunction func(map[string]any) any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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