templates

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BuiltinPrefix marks a template source as an embedded built-in template.
	BuiltinPrefix = "builtin:"
)

Variables

This section is empty.

Functions

func IsBuiltin

func IsBuiltin(source string) bool

IsBuiltin reports whether source references an embedded built-in template.

func Name

func Name(source string) string

Name trims the builtin prefix and surrounding whitespace from source.

Types

type Templates

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

Templates reads built-in templates from an injected filesystem.

func New

func New(files fs.FS) Templates

New creates a built-in template registry backed by files.

func (Templates) Exists

func (t Templates) Exists(source string) error

Exists reports whether the named built-in template can be read.

func (Templates) Names

func (t Templates) Names() []string

Names returns all available built-in template names.

func (Templates) Read

func (t Templates) Read(source string) (filename string, body string, err error)

Read returns an embedded built-in template by name.

Jump to

Keyboard shortcuts

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