template

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTemplateNotFound = errors.New("template not found")

Functions

This section is empty.

Types

type Compiler

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

func NewCompiler

func NewCompiler(config *config.Config) *Compiler

func (*Compiler) Compile

func (c *Compiler) Compile(content string) (string, error)

type Renderer

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

func NewRenderer

func NewRenderer(documents, partials []Template) *Renderer

func (*Renderer) Documents

func (r *Renderer) Documents() []Template

func (*Renderer) Render

func (r *Renderer) Render(name string, data any) (string, error)

type Template

type Template struct {
	Name    string
	Content string
}

Jump to

Keyboard shortcuts

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