Documentation ¶
Index ¶
- Constants
- func PageRenderTransition(page *Page) *ut.SimpleTray[*RenderedPage]
- type Builder
- func (d *Builder) AddPage(page *Page)
- func (d *Builder) AddPages(pages []*Page)
- func (d *Builder) AppendSection(section fss.Sectioner)
- func (d *Builder) AppendSections(sections []fss.Sectioner)
- func (b *Builder) Apply(elem fsp.FStringer) error
- func (b *Builder) Build() (*DocumentViewer, error)
- func (b *Builder) Reset()
- type Document
- type DocumentViewer
- type Page
- type RenderedPage
Constants ¶
View Source
const ( // DefaultPageWidth is the default width of a page. DefaultPageWidth int = 80 // DefaultPageHeight is the default height of a page. DefaultPageHeight int = 24 )
Variables ¶
This section is empty.
Functions ¶
func PageRenderTransition ¶
func PageRenderTransition(page *Page) *ut.SimpleTray[*RenderedPage]
Types ¶
type Builder ¶
type Builder struct { // Traversor is the traversor used by the builder. *fsp.Traversor // contains filtered or unexported fields }
Builder is a type that represents a builder for creating formatted strings.
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder creates a new builder with the default configuration.
Returns:
- *Builder: A pointer to the new builder.
func (*Builder) AppendSection ¶
func (*Builder) AppendSections ¶
func (*Builder) Apply ¶
Apply is a function that applies the element to the builder.
Parameters:
- elem: The element to apply.
Returns:
- error: An error if the application fails.
func (*Builder) Build ¶
func (b *Builder) Build() (*DocumentViewer, error)
Build is a function that builds the document.
Returns:
- *Document: The document.
- error: An error if the building fails.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func NewDocument ¶
func NewDocument() *Document
type DocumentViewer ¶
type DocumentViewer struct { *ut.DynamicTray[*Page, *RenderedPage] }
DocumentViewer is a type that represents a document.
func MakeDocument ¶
func MakeDocument(rawPages [][][][]string) (*DocumentViewer, error)
MakeDocument creates a new document.
Parameters:
- rawPages: The raw pages to add to the document.
Returns:
- *Document: A pointer to the newly created document.
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
Page is a type that represents a page of a document.
func (*Page) View ¶
func (p *Page) View() ([]*RenderedPage, error)
type RenderedPage ¶
type RenderedPage struct {
// contains filtered or unexported fields
}
RenderedPage is a type that represents a page of a document.
func NewRenderedPage ¶
func NewRenderedPage(render *fss.Render, pageNumber, subPageNumber int) *RenderedPage
Click to show internal directories.
Click to hide internal directories.