Documentation
¶
Index ¶
- func InitRegistry(l *lua.State)
- func Open(l *lua.State)
- type CallbackRegistry
- func (cr *CallbackRegistry) Add(event, name string, position callbackPosition)
- func (cr *CallbackRegistry) Fire(event string, setupArgs func(*lua.State) int) error
- func (cr *CallbackRegistry) InstallPageInit()
- func (cr *CallbackRegistry) InstallPostElement()
- func (cr *CallbackRegistry) InstallPreShipout(feDoc *fe.Document)
- func (cr *CallbackRegistry) List(event string) []string
- func (cr *CallbackRegistry) Remove(event, name string)
- func (cr *CallbackRegistry) SetCSSBuilder(cb *htmlbag.CSSBuilder)
- type Color
- type ColorProfile
- type Document
- type ElementInfo
- type Face
- type FontFamily
- type FontSource
- type ImageNode
- type Imagefile
- type Language
- type Page
- type PageInfo
- type SVGDocument
- type SVGNode
- type StructureElement
- type Table
- type TableCell
- type TableRow
- type Text
- type TextSettings
- type VList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRegistry ¶
InitRegistry creates a new CallbackRegistry for the given Lua state.
Types ¶
type CallbackRegistry ¶
type CallbackRegistry struct {
// contains filtered or unexported fields
}
CallbackRegistry manages named, ordered callbacks per event.
func GetRegistry ¶
func GetRegistry() *CallbackRegistry
GetRegistry returns the package-level callback registry.
func (*CallbackRegistry) Add ¶
func (cr *CallbackRegistry) Add(event, name string, position callbackPosition)
Add inserts a callback. position is "back" (default), "front", or a relative spec.
func (*CallbackRegistry) Fire ¶
Fire calls all registered Lua callbacks for an event. setupArgs is called to push arguments onto the Lua stack and returns the arg count.
func (*CallbackRegistry) InstallPageInit ¶
func (cr *CallbackRegistry) InstallPageInit()
InstallPageInit registers a Go-level PageInitCallback on the CSSBuilder that fires all registered Lua "page_init" callbacks.
func (*CallbackRegistry) InstallPostElement ¶
func (cr *CallbackRegistry) InstallPostElement()
InstallPostElement registers a Go-level ElementCallback on the CSSBuilder that fires all registered Lua "post_element" callbacks.
func (*CallbackRegistry) InstallPreShipout ¶
func (cr *CallbackRegistry) InstallPreShipout(feDoc *fe.Document)
InstallPreShipout registers a Go-level PreShipout callback on the document that fires all registered Lua "pre_shipout" callbacks.
func (*CallbackRegistry) List ¶
func (cr *CallbackRegistry) List(event string) []string
List returns the callback names in execution order for the given event.
func (*CallbackRegistry) Remove ¶
func (cr *CallbackRegistry) Remove(event, name string)
Remove removes a named callback from an event.
func (*CallbackRegistry) SetCSSBuilder ¶
func (cr *CallbackRegistry) SetCSSBuilder(cb *htmlbag.CSSBuilder)
SetCSSBuilder stores the CSSBuilder reference so that callbacks can access page dimensions and CSS information.
type ColorProfile ¶
type ColorProfile struct {
Value *document.ColorProfile
}
ColorProfile wraps the document.ColorProfile type
type ElementInfo ¶
type ElementInfo struct {
// contains filtered or unexported fields
}
ElementInfo wraps an htmlbag.ElementEvent to expose element information to Lua callbacks.
type FontFamily ¶
type FontFamily struct {
Value *frontend.FontFamily
// contains filtered or unexported fields
}
FontFamily wraps the boxesandglue frontend.FontFamily type
type FontSource ¶
type FontSource struct {
Value *frontend.FontSource
}
FontSource wraps the boxesandglue frontend.FontSource type
type PageInfo ¶
type PageInfo struct {
// contains filtered or unexported fields
}
PageInfo wraps an htmlbag.CSSBuilder to expose page layout and CSS information to Lua callbacks.
type SVGDocument ¶
SVGDocument wraps a parsed svgreader.Document for Lua.
type SVGNode ¶
SVGNode wraps a node.Rule containing rendered SVG content. The Value field is discovered by extractNodeViaReflection, so SVGNode works automatically with node.vpack() and page:output_at().
type StructureElement ¶
type StructureElement struct {
Value *document.StructureElement
}
StructureElement wraps a document.StructureElement for Lua access.
type TextSettings ¶
type TextSettings struct {
// contains filtered or unexported fields
}
TextSettings provides access to Text.Settings