page

package
v0.0.0-...-8b68c8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2023 License: GPL-3.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStyledText

func CreateStyledText(tc RowChunk) string

CreateStyledText returns text field with applied style

func RemoveStyleTextMarkers

func RemoveStyleTextMarkers(text string) string

RemoveStyleTextMarkers removes styled markers from string

Types

type Body

type Body struct {
	// contains filtered or unexported fields
}

Body contains data for display page

func MakeBody

func MakeBody(rows []Row) Body

MakeBody creates page Body object

func (*Body) Row

func (b *Body) Row(i index.Index) Row

Row returns row by index

func (*Body) RowCount

func (b *Body) RowCount() index.Index

RowCount returns row count

type Row

type Row struct {
	// contains filtered or unexported fields
}

Row - paragraph row

func MakeRow

func MakeRow(marginLeft size.Width, chunks ...RowChunk) Row

MakeRow constructs Row object on stack

func (*Row) GetMarginLeft

func (r *Row) GetMarginLeft() size.Width

GetMarginLeft gets marginLeft field

func (*Row) GetTextRuneCount

func (r *Row) GetTextRuneCount() size.Width

GetTextRuneCount gets textRuneCount field

func (*Row) GetTextStyled

func (r *Row) GetTextStyled() string

GetTextStyled gets textStyled field

type RowChunk

type RowChunk struct {
	// contains filtered or unexported fields
}

RowChunk contains data for display styled text part of row

func MakeRowChunk

func MakeRowChunk(text string, styles ...StyleTextMask) RowChunk

MakeRowChunk creates RowChunk

func MakeRowChunkSpaces

func MakeRowChunkSpaces(countSpaces size.Width) RowChunk

MakeRowChunkSpaces creates RowChunk with countSpaces spaces

func (*RowChunk) CountRunes

func (tc *RowChunk) CountRunes() size.Width

CountRunes returns size text field as rune slice

func (*RowChunk) GetStyle

func (tc *RowChunk) GetStyle() StyleTextMask

GetStyle gets style field

func (*RowChunk) GetText

func (tc *RowChunk) GetText() string

GetText gets text field

type StyleTextMask

type StyleTextMask int

StyleTextMask - style of text byte mask

const (
	// StyleTextDefault - default value of StyleTextMask
	StyleTextDefault StyleTextMask = 0

	// StyleTextBold - use bold text
	StyleTextBold StyleTextMask = 0x1

	// StyleTextUnderlined - use underlined text
	StyleTextUnderlined StyleTextMask = 0x2
)

func (StyleTextMask) Has

func (m StyleTextMask) Has(check StyleTextMask) bool

Has returns if StyleTextMask has set StyleTextMask

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL