render

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package render exposes commands used by package express to render templates. Keeping these functions separated allows us to exclude express from the runtime.

Code generated by Tapestry; edit at your own risk.

Index

Constants

This section is empty.

Variables

View Source
var (
	CmdError    = assign.CmdError
	CmdErrorCtx = assign.CmdErrorCtx
)
View Source
var Z_Types = typeinfo.TypeSet{
	Name:       "render",
	Slot:       z_slot_list,
	Flow:       z_flow_list,
	Signatures: z_signatures,
}

package listing of type data

View Source
var Zt_RenderEval = typeinfo.Slot{
	Name: "render_eval",
	Markup: map[string]any{
		"comment": "Used with render pattern for arguments of unknown type.",
	},
}

render_eval, a type of slot.

View Source
var Zt_RenderName typeinfo.Flow

render_name, a type of flow.

View Source
var Zt_RenderPattern typeinfo.Flow

render_pattern, a type of flow.

View Source
var Zt_RenderRef typeinfo.Flow

render_ref, a type of flow.

View Source
var Zt_RenderResponse typeinfo.Flow

render_response, a type of flow.

View Source
var Zt_RenderValue typeinfo.Flow

render_value, a type of flow.

Functions

This section is empty.

Types

type RenderEval

type RenderEval interface {
	RenderEval(run rt.Runtime, hint affine.Affinity) (rt.Value, error)
}

helps patterns handle values when the affinity isn't known in advance

type RenderEval_Slot

type RenderEval_Slot struct{ Value RenderEval }

holds a single slot.

func (*RenderEval_Slot) TypeInfo

func (*RenderEval_Slot) TypeInfo() typeinfo.T

implements typeinfo.Instance for a single slot.

type RenderEval_Slots

type RenderEval_Slots []RenderEval

holds a slice of slots.

func (*RenderEval_Slots) Repeats

func (op *RenderEval_Slots) Repeats() bool

implements typeinfo.Repeats

func (*RenderEval_Slots) TypeInfo

func (*RenderEval_Slots) TypeInfo() typeinfo.T

implements typeinfo.Instance for a series of slots.

type RenderName

type RenderName struct {
	Name   string
	Markup map[string]any
}

Handles changing a template like {.boombip} into text. If the name is a variable containing an object name: return the printed object name ( via "print name" ); if the name is a variable with some other text: return that text; if the name isn't a variable but refers to some object: return that object's printed object name; otherwise, its an error.

func (*RenderName) GetMarkup

func (op *RenderName) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RenderName) GetText

func (op *RenderName) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*RenderName) TypeInfo

func (*RenderName) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderName_Slice

type RenderName_Slice []RenderName

holds a slice of type render_name

func (*RenderName_Slice) Repeats

func (op *RenderName_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RenderName_Slice) TypeInfo

func (*RenderName_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderPattern

type RenderPattern struct {
	PatternName string
	Render      []RenderEval
	Markup      map[string]any
}

A version of core's call pattern that figures out how to evaluate its arguments at runtime.

func (*RenderPattern) Execute

func (op *RenderPattern) Execute(run rt.Runtime) error

func (*RenderPattern) GetBool

func (op *RenderPattern) GetBool(run rt.Runtime) (rt.Value, error)

func (*RenderPattern) GetMarkup

func (op *RenderPattern) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RenderPattern) GetNumList

func (op *RenderPattern) GetNumList(run rt.Runtime) (rt.Value, error)

func (*RenderPattern) GetNumber

func (op *RenderPattern) GetNumber(run rt.Runtime) (rt.Value, error)

func (*RenderPattern) GetRecord

func (op *RenderPattern) GetRecord(run rt.Runtime) (rt.Value, error)

func (*RenderPattern) GetRecordList

func (op *RenderPattern) GetRecordList(run rt.Runtime) (rt.Value, error)

func (*RenderPattern) GetText

func (op *RenderPattern) GetText(run rt.Runtime) (ret rt.Value, err error)

expressions are text patterns... so for now adapt via text ideally could generate the buffer based on the pattern type at assembly type

func (*RenderPattern) GetTextList

func (op *RenderPattern) GetTextList(run rt.Runtime) (rt.Value, error)

func (*RenderPattern) RenderEval

func (op *RenderPattern) RenderEval(run rt.Runtime, hint affine.Affinity) (ret rt.Value, err error)

one of the above evals might be called, or this might be called directly from a different pattern the hint tells us what return value type is expected.

func (*RenderPattern) TypeInfo

func (*RenderPattern) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderPattern_Slice

type RenderPattern_Slice []RenderPattern

holds a slice of type render_pattern

func (*RenderPattern_Slice) Repeats

func (op *RenderPattern_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RenderPattern_Slice) TypeInfo

func (*RenderPattern_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderRef

type RenderRef struct {
	Name   rtti.TextEval
	Dot    []assign.Dot
	Markup map[string]any
}

Pull a value from name that might refer either to a variable, or to an object. If the name is an object, returns the object id.

func (*RenderRef) GetBool

func (op *RenderRef) GetBool(run rt.Runtime) (ret rt.Value, err error)

func (*RenderRef) GetMarkup

func (op *RenderRef) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RenderRef) GetNumList

func (op *RenderRef) GetNumList(run rt.Runtime) (ret rt.Value, err error)

func (*RenderRef) GetNumber

func (op *RenderRef) GetNumber(run rt.Runtime) (ret rt.Value, err error)

func (*RenderRef) GetRecord

func (op *RenderRef) GetRecord(run rt.Runtime) (ret rt.Value, err error)

func (*RenderRef) GetRecordList

func (op *RenderRef) GetRecordList(run rt.Runtime) (ret rt.Value, err error)

func (*RenderRef) GetText

func (op *RenderRef) GetText(run rt.Runtime) (ret rt.Value, err error)

GetText handles unpacking a text variable, turning an object variable into an id, or looking for an object of the passed name ( if no variable of the name exists. )

func (*RenderRef) GetTextList

func (op *RenderRef) GetTextList(run rt.Runtime) (ret rt.Value, err error)

func (*RenderRef) RenderEval

func (op *RenderRef) RenderEval(run rt.Runtime, hint affine.Affinity) (ret rt.Value, err error)

func (*RenderRef) TypeInfo

func (*RenderRef) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderRef_Slice

type RenderRef_Slice []RenderRef

holds a slice of type render_ref

func (*RenderRef_Slice) Repeats

func (op *RenderRef_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RenderRef_Slice) TypeInfo

func (*RenderRef_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderResponse

type RenderResponse struct {
	Name   string
	Text   rtti.TextEval
	Markup map[string]any
}

Generate text in a replaceable manner.

func (*RenderResponse) Execute

func (op *RenderResponse) Execute(run rt.Runtime) (err error)

prints the response via the runtime's writer.

func (*RenderResponse) GetMarkup

func (op *RenderResponse) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RenderResponse) GetText

func (op *RenderResponse) GetText(run rt.Runtime) (ret rt.Value, err error)

return the rendered response as a text value.

func (*RenderResponse) TypeInfo

func (*RenderResponse) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderResponse_Slice

type RenderResponse_Slice []RenderResponse

holds a slice of type render_response

func (*RenderResponse_Slice) Repeats

func (op *RenderResponse_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RenderResponse_Slice) TypeInfo

func (*RenderResponse_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderValue

type RenderValue struct {
	Value  rtti.Assignment
	Markup map[string]any
}

Pull a value from an assignment of unknown affinity.

func (*RenderValue) GetMarkup

func (op *RenderValue) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RenderValue) RenderEval

func (op *RenderValue) RenderEval(run rt.Runtime, hint affine.Affinity) (ret rt.Value, err error)

func (*RenderValue) TypeInfo

func (*RenderValue) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RenderValue_Slice

type RenderValue_Slice []RenderValue

holds a slice of type render_value

func (*RenderValue_Slice) Repeats

func (op *RenderValue_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RenderValue_Slice) TypeInfo

func (*RenderValue_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

Jump to

Keyboard shortcuts

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