Documentation
¶
Overview ¶
Package page contains utilities for rendering documents.
Index ¶
- func ExecuteTemplate(w io.Writer, tmpl string, d *Document) error
- type Block
- func (b Block) Ability() string
- func (b Block) ActionsText() string
- func (b Block) ColorText() string
- func (b Block) Description() string
- func (b Block) Header() iter.Seq2[string, string]
- func (b Block) HeaderEnd() float64
- func (b Block) HeaderItems() float64
- func (b Block) Name() string
- func (b Block) Source() string
- type Document
- type DocumentEntry
- type DocumentOptions
- type DocumentPage
- type Page
- type Position
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct {
*aon.Entry
Position Position
Index Position
Color string
Size float64
ExtraHeader float64
}
Block represents an information block.
func (Block) ActionsText ¶
ActionsText returns the actions text for the embedded Entry. It is meant to be used with the Pathfinder2eActions font.
Symbols in the font are: - 1/a/A: single action - 2/d/D: two actions - 3/t/T: three actions - 4/f/F: Free action - 5/r/R: Reaction
func (Block) ColorText ¶
ColorText returns the text color for the block. It is based on the Color field when set, but falls back to a color based on the type of the AoN entry.
func (Block) Description ¶
Description returns the sanitized description for the Entry.
func (Block) HeaderItems ¶
HeaderItems returns the number of header items.
type Document ¶
type Document struct {
Pages []Page
}
Document represents a multi-page document that can be rendered.
func NewDocument ¶
func NewDocument(options DocumentOptions) *Document
NewDocument returns an initialized Document based on the given options.
type DocumentEntry ¶
DocumentEntry represents an unparsed document entry. It is transformed into a Block.
type DocumentOptions ¶
type DocumentOptions struct {
Pages []DocumentPage
}
DocumentOptions contains the options for creating a document.
type DocumentPage ¶
type DocumentPage struct {
Title string
Left, Right []DocumentEntry
}
DocumentPage represents an unparsed document page. It is transformed into a Page.