templater

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

README

templater

The templater project is used to create a *template.Templater from html/template from either an embedded directory or a directory from the operating system.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskTemplater

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

func (*DiskTemplater) Tmpl

func (d *DiskTemplater) Tmpl() *template.Template

type EmbeddedTemplater

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

func (EmbeddedTemplater) Tmpl

type Templater

type Templater interface {
	Tmpl() *template.Template
}

func New added in v0.0.3

func New(dir string, options TemplaterOptions) (Templater, error)

func NewDiskTemplater

func NewDiskTemplater(dir string, funcMap template.FuncMap, pattern, rootTemplateName string) Templater

func NewEmbeddedTemplater

func NewEmbeddedTemplater(dir string, embedded fs.FS, funcMap template.FuncMap, pattern, rootTemplateName string) (Templater, error)

type TemplaterOptions added in v0.0.3

type TemplaterOptions struct {
	Embedded         fs.FS
	FuncMap          template.FuncMap
	Pattern          string
	RootTemplateName string
}

Jump to

Keyboard shortcuts

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