handlebars

package
v0.0.0-...-3de8ebd Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const EngineName = "handlebars"

EngineName engine name

Variables

View Source
var DefaultEngine = &Engine{}

DefaultEngine registered.

Functions

func Register

func Register()

Register register engine

Types

type Engine

type Engine struct{}

Engine engine struct

func (*Engine) Parse

func (e *Engine) Parse(template string, env herbtext.Environment) (texttemplate.Template, error)

Parse parse given template with given environment to template view.

func (*Engine) Supported

func (e *Engine) Supported(env herbtext.Environment) (directives []string, err error)

Supported return supported directives which can be used in template string.

type View

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

View handlebars template view

func (*View) Render

func (v *View) Render(data interface{}) (output string, err error)

Render render given data and return output string and any error if raised.

Jump to

Keyboard shortcuts

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