handlebars

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package handlebars renders Handlebars templates.

CyberChef's Template operation calls the handlebars npm package; there is no maintained Go port, so this covers the part of the language a template can usefully be written in: variables with HTML escaping, path and literal arguments, block helpers (#if, #unless, #each, #with), partials, and comments. Compile parses a source string and Template.Render evaluates it against decoded JSON data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

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

Template is a parsed template ready to be rendered against a value.

func Compile

func Compile(source string) (*Template, error)

Compile reads a template.

func (*Template) Render

func (t *Template) Render(data any) (string, error)

Render renders the template against a value.

Jump to

Keyboard shortcuts

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