templating

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 4 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 embed.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.

Jump to

Keyboard shortcuts

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