tmpl

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package tmpl provides shared Go template rendering with go:embed support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

FuncMap returns the shared custom template functions available in all templates.

func Render

func Render(name, tmplStr string, data any) (string, error)

Render renders a template string with the given data and custom functions.

func RenderToFile

func RenderToFile(name, tmplStr string, data any, outPath string) error

RenderToFile renders a template string and writes the result to a file.

func RenderWithPartials added in v1.9.0

func RenderWithPartials(name, tmplStr string, partials map[string]string, data any) (string, error)

RenderWithPartials renders a template string with named partial templates.

Types

This section is empty.

Jump to

Keyboard shortcuts

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