tmpl

package
v0.0.0-...-52ea55a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(a, b *Tree)

Types

type Tree

type Tree struct {
	Statics        []string
	Dynamics       []any // string | *Tree | []any
	ExcludeStatics bool  // controls if MarshalText Statics with serializing
	Title          string
	Events         [][]byte
	// contains filtered or unexported fields
}

func NewTree

func NewTree() *Tree

func (*Tree) AppendDynamic

func (t *Tree) AppendDynamic(d string)

func (*Tree) AppendRangeSub

func (t *Tree) AppendRangeSub() *Tree

AppendRangeSub adds a range subnode to tree. Templates call it on entering a range statement.

func (*Tree) AppendStatic

func (t *Tree) AppendStatic(text string)

func (*Tree) AppendSub

func (t *Tree) AppendSub() *Tree

func (*Tree) IncRangeStep

func (t *Tree) IncRangeStep()

IncRangeStep records that a single range iteration has completed it.

func (*Tree) JSON

func (t *Tree) JSON() ([]byte, error)

JSON returns a JSON representation of the tree.

func (*Tree) RenderTo

func (t *Tree) RenderTo(w io.Writer) error

RenderTo renders the content represented by t to w.

func (*Tree) Valid

func (t *Tree) Valid() error

Valid performs an internal consistency check and returns an error if it fails.

func (*Tree) WriteTo

func (t *Tree) WriteTo(w io.Writer) (written int64, err error)

WriteTo writes a JSON representation of the tree to w.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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