Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source pure

Readme View source

gno.land/p/moul/template/v0

TODO: describe this package.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/p/moul/template/v0 dependency graph

⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.

Functions 1

func NewRenderer

1func NewRenderer() *Renderer
source

NewRenderer creates a new template renderer with default functions

Types 3

type Func

func
1type Func func(args ...string) string
source

Func is the signature for template functions

type Helper

interface
1type Helper interface {
2	Execute(args []string, data map[string]interface{}) string
3}
source

Helper is kept for backward compatibility

type Renderer

struct
1type Renderer struct {
2	funcs map[string]Func        // Template functions
3	data  map[string]interface{} // Global data
4	ctx   *context               // Current evaluation context
5}
source

Renderer provides a simple template engine with a clean API

Methods on Renderer

func Render

method on Renderer
1func (r *Renderer) Render(template string, data map[string]interface{}) string
source

Render processes a template with the given data

Imports 6

Source Files 3