templating

package
v0.4.18 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package templating provides an `Engine` for managing templates stored in an embedded filesystem. Use `Parse` to load multiple templates (via glob patterns), and `Render` to execute them with custom data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine added in v0.1.23

type Engine struct {
	// contains filtered or unexported fields
}

Engine is a simple wrapper around the Go templating engine.

func NewEngine added in v0.1.23

func NewEngine(efs fs.FS) *Engine

NewEngine creates a new templating engine.

func (*Engine) Parse added in v0.1.23

func (a *Engine) Parse(patterns ...string)

Parse parses the templates in the given path.

func (*Engine) Render added in v0.1.23

func (a *Engine) Render(w io.Writer, name string, data any) error

Render renders the template with the given name and data.

func (*Engine) View added in v0.4.7

func (a *Engine) View(name string, data any) http.HandlerFunc

View returns an http.HandlerFunc that renders the template with the given name and data.

Jump to

Keyboard shortcuts

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