Documentation ¶
Index ¶
- Constants
- Variables
- func FakeBoldStyler(m *font.Manager, f Font, t mark.Tag) (*font.Face, error)
- func NodeLookup(sym string) *exp.Spec
- func ZeroStyler(m *font.Manager, f Font, t mark.Tag) (*font.Face, error)
- type Border
- type Box
- type Code
- type Color
- type Dim
- type Font
- type Layouter
- type Node
- type NodeLayout
- type Off
- type Pos
- type Styler
- type Table
Constants ¶
View Source
const ( AlignLeft = iota AlignRight AlignCenter )
Variables ¶
View Source
var Env = exp.Builtin{ NodeLookup, utl.StrLib.Lookup(), utl.TimeLib.Lookup(), std.Core, std.Decl, }
Env is the default resolver environment for layla.
Functions ¶
func NodeLookup ¶
NodeLookup is the resolver lookup for layla node resolvers
Types ¶
type Border ¶
type Code ¶
type Code struct { Name string `json:"name,omitempty"` Human int `json:"human,omitempty"` Wide float64 `json:"wide,omitempty"` }
Code holds all qr and barcode related node data
type Font ¶
type Font struct { Name string `json:"name,omitempty"` Size float64 `json:"size,omitempty"` Line float64 `json:"line,omitempty"` Style mark.Tag `json:"-"` Height font.Pt `json:"-"` }
Font holds all font related node data
type Layouter ¶
Layouter implements the layout routine and holds required context
type Node ¶
type Node struct { Kind string `json:"kind"` Box NodeLayout Font *Font `json:"font,omitempty"` Border Border `json:"border,omitempty"` List []*Node `json:"list,omitempty"` Table Code *Code `json:"code,omitempty"` Data string `json:"data,omitempty"` Calc Box `json:"-"` }
Node is a part of the display tree represents all display elements.
func Execute ¶
Execute parses and executes the expression from reader r and returns a node or error.
func ExecuteString ¶
ExecuteString parses and executes the expression string s and returns a node or error.
type NodeLayout ¶
type NodeLayout struct { Mar *Off `json:"mar,omitempty"` Pad *Off `json:"pad,omitempty"` Rot int `json:"rot,omitempty"` Align int `json:"align,omitempty"` Gap float64 `json:"gap,omitempty"` Sub Dim `json:"sub,omitempty"` }
NodeLayout holds all layout related node data
type Off ¶
type Off struct { L float64 `json:"l,omitempty"` T float64 `json:"t,omitempty"` R float64 `json:"r,omitempty"` B float64 `json:"b,omitempty"` }
Off is a box offset consisting of left, top, right and bottom offsets in mm.
Directories ¶
Path | Synopsis |
---|---|
Package html implements a layla renderer for html previews.
|
Package html implements a layla renderer for html previews. |
Package mark provides a simple markdown text format.
|
Package mark provides a simple markdown text format. |
Package pdf implements a layla renderer for PDF using the jung-kurt/gofpdf package.
|
Package pdf implements a layla renderer for PDF using the jung-kurt/gofpdf package. |
Package tspl implements a layla renderer for TSC thermal label printer using TSPL.
|
Package tspl implements a layla renderer for TSC thermal label printer using TSPL. |
Click to show internal directories.
Click to hide internal directories.