Documentation
¶
Overview ¶
Text template rendering. ( everything is "internal" because text templates generate the commands;
nothing is exposed for authors. )
Index ¶
- Variables
- func Register(reg func(any))
- type RenderEval
- type RenderEval_Slot
- type RenderEval_Slots
- type RenderName
- type RenderName_Slice
- type RenderPattern
- func (op *RenderPattern) Execute(run rt.Runtime) error
- func (op *RenderPattern) GetBool(run rt.Runtime) (rt.Value, error)
- func (op *RenderPattern) GetMarkup(ensure bool) map[string]any
- func (op *RenderPattern) GetNum(run rt.Runtime) (rt.Value, error)
- func (op *RenderPattern) GetNumList(run rt.Runtime) (rt.Value, error)
- func (op *RenderPattern) GetRecord(run rt.Runtime) (rt.Value, error)
- func (op *RenderPattern) GetRecordList(run rt.Runtime) (rt.Value, error)
- func (op *RenderPattern) GetText(run rt.Runtime) (ret rt.Value, err error)
- func (op *RenderPattern) GetTextList(run rt.Runtime) (rt.Value, error)
- func (op *RenderPattern) RenderEval(run rt.Runtime, hint affine.Affinity) (ret rt.Value, err error)
- func (*RenderPattern) TypeInfo() typeinfo.T
- type RenderPattern_Slice
- type RenderResponse
- type RenderResponse_Slice
- type RenderValue
- type RenderValue_Slice
- type UnknownDot
- func (op *UnknownDot) GetBool(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) GetMarkup(ensure bool) map[string]any
- func (op *UnknownDot) GetNum(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) GetNumList(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) GetRecord(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) GetRecordList(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) GetText(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) GetTextList(run rt.Runtime) (ret rt.Value, err error)
- func (op *UnknownDot) RenderEval(run rt.Runtime, hint affine.Affinity) (ret rt.Value, err error)
- func (*UnknownDot) TypeInfo() typeinfo.T
- type UnknownDot_Slice
Constants ¶
This section is empty.
Variables ¶
var Z_Types = typeinfo.TypeSet{ Name: "render", Comment: []string{ "Text template rendering.", "( everything is \"internal\" because text templates generate the commands;", " nothing is exposed for authors. )", }, Slot: z_slot_list, Flow: z_flow_list, Signatures: z_signatures, }
package listing of type data
var Zt_RenderEval = typeinfo.Slot{ Name: "render_eval", Markup: map[string]any{ "--": "Used with render pattern for arguments of unknown type.", "internal": true, }, }
render_eval, a type of slot.
var Zt_RenderName typeinfo.Flow
render_name, a type of flow.
var Zt_RenderPattern typeinfo.Flow
render_pattern, a type of flow.
var Zt_RenderResponse typeinfo.Flow
render_response, a type of flow.
var Zt_RenderValue typeinfo.Flow
render_value, a type of flow.
var Zt_UnknownDot typeinfo.Flow
unknown_dot, a type of flow.
Functions ¶
Types ¶
type RenderEval ¶
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 for a slice of slots.
func (*RenderEval_Slots) TypeInfo ¶
func (*RenderEval_Slots) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of slots.
type RenderName ¶
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
type RenderName_Slice ¶
type RenderName_Slice []RenderName
Holds a slice of type RenderName.
func (*RenderName_Slice) Repeats ¶
func (op *RenderName_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RenderName.
func (*RenderName_Slice) TypeInfo ¶
func (*RenderName_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RenderName.
type RenderPattern ¶
type RenderPattern struct { PatternName string Render []RenderEval Markup map[string]any `json:",omitempty"` }
A version of core's call pattern that figures out how to evaluate its arguments at runtime.
func (*RenderPattern) GetMarkup ¶
func (op *RenderPattern) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*RenderPattern) GetNumList ¶
func (*RenderPattern) GetRecordList ¶
func (*RenderPattern) GetText ¶
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 (*RenderPattern) RenderEval ¶
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 RenderPattern.
func (*RenderPattern_Slice) Repeats ¶
func (op *RenderPattern_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RenderPattern.
func (*RenderPattern_Slice) TypeInfo ¶
func (*RenderPattern_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RenderPattern.
type RenderResponse ¶
type RenderResponse struct { Name string Text rtti.TextEval Markup map[string]any `json:",omitempty"` }
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) TypeInfo ¶
func (*RenderResponse) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type RenderResponse_Slice ¶
type RenderResponse_Slice []RenderResponse
Holds a slice of type RenderResponse.
func (*RenderResponse_Slice) Repeats ¶
func (op *RenderResponse_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RenderResponse.
func (*RenderResponse_Slice) TypeInfo ¶
func (*RenderResponse_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RenderResponse.
type RenderValue ¶
type RenderValue struct { Value rtti.Assignment Markup map[string]any `json:",omitempty"` }
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 (*RenderValue) TypeInfo ¶
func (*RenderValue) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type RenderValue_Slice ¶
type RenderValue_Slice []RenderValue
Holds a slice of type RenderValue.
func (*RenderValue_Slice) Repeats ¶
func (op *RenderValue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RenderValue.
func (*RenderValue_Slice) TypeInfo ¶
func (*RenderValue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RenderValue.
type UnknownDot ¶ added in v0.24.6
type UnknownDot struct { Name rtti.TextEval Dot []object.Dot Markup map[string]any `json:",omitempty"` }
Pull a value from name that might refer either to a variable, or to an object. This gets used by text templates when processing names. The templates don't attempt to determine which names are objects and which names are variables. For instance:
- Say: "{.story.title} by {.story.author}"
uses UnknownDot for accessing "story".
func (*UnknownDot) GetMarkup ¶ added in v0.24.6
func (op *UnknownDot) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*UnknownDot) GetNumList ¶ added in v0.24.6
func (*UnknownDot) GetRecordList ¶ added in v0.24.6
func (*UnknownDot) GetText ¶ added in v0.24.6
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 (*UnknownDot) GetTextList ¶ added in v0.24.6
func (*UnknownDot) RenderEval ¶ added in v0.24.6
func (*UnknownDot) TypeInfo ¶ added in v0.24.6
func (*UnknownDot) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type UnknownDot_Slice ¶ added in v0.24.6
type UnknownDot_Slice []UnknownDot
Holds a slice of type UnknownDot.
func (*UnknownDot_Slice) Repeats ¶ added in v0.24.6
func (op *UnknownDot_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of UnknownDot.
func (*UnknownDot_Slice) TypeInfo ¶ added in v0.24.6
func (*UnknownDot_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of UnknownDot.