Documentation ¶
Index ¶
- Constants
- func FillBg(color lipgloss.TerminalColor, src string, w, h int) string
- func NewCell(raw string, opts ...CellOpt) cell
- func NewEngine(ctx context.Context, doc vui.Documentary) *engine
- func NewStyling() styling
- func NewTissue(cs cells, s *styling) *tissue
- func TransformFrom(base styling) transformer
- func WithDisplay(d string) func(*cell)
- func WithPosition(x int, y int) func(*cell)
- type Anchor
- type Body
- type Br
- type Button
- type CellOpt
- type Div
- type Executor
- type FieldSet
- type Form
- type Head
- type Heading
- type Hr
- type Html
- type Img
- type Input
- type Label
- type Legend
- type OptGroup
- type Option
- type Paragraph
- type Registry
- type Select
- type Span
- type Text
- type Unknown
Constants ¶
View Source
const ( DISPLAY_BLOCK = iota + 1 DISPLAY_CONTENT DISPLAY_INLINE DISPLAY_INLINE_BLOCK DISPLAY_FLEX DISPLAY_NONE )
View Source
const ( TAG_BODY = iota + 1 TAG_BR TAG_BUTTON TAG_DIV TAG_FIELDSET TAG_FORM TAG_HEAD TAG_HEADING TAG_HR TAG_HTML TAG_IMG TAG_INPUT TAG_LABEL TAG_LEGEND TAG_OPTGROUP TAG_OPTION TAG_PARAGRAPH TAG_SELECT TAG_SPAN TAG_TEXT TAG_UNKNOWN )
View Source
const ANSI_BG_RGB_COLOR = "\x1b[48;2;%d;%d;%dm"
View Source
const ANSI_BG_TRANSPARENT_COLOR = "\x1b[0;39;49m"
View Source
const ANSI_CURSOR_HIDE = "\x1B[?25l"
View Source
const ANSI_CURSOR_SHOW = "\x1B[?25h"
View Source
const ANSI_CURSOR_UP = "\x1B[%dA"
View Source
const ANSI_FG_RGB_COLOR = "\x1b[38;2;%d;%d;%dm▄"
View Source
const ANSI_FG_TRANSPARENT_COLOR = "\x1b[0m "
View Source
const ANSI_RESET = "\x1b[0m"
View Source
const DEFAULT_TERM_COLS = 80
View Source
const DEFAULT_TERM_ROWS = 24
View Source
const FPS = 15
Variables ¶
This section is empty.
Functions ¶
func NewTissue ¶
func NewTissue(cs cells, s *styling) *tissue
Tissue is matrix of cell: [][]cell Tissue receive list cells and compute to matrix cells adapt these rules: - If cell is display block - It must display reside inside one row - If cell is display-block, it able to append to previous row - If cell is display-block the total width of all cells in a row not great than iMaxWidth
func TransformFrom ¶
func TransformFrom(base styling) transformer
Transform receive base styling (parent style) Compute and return new styling The following is attr applied from css:
- margin - padding - border - background (inherit) - color (inherit) - display
The following is rule applied specific cases:
- width always less than terminal width updated when css.width less than base.width base.width - base.padding
- height always less than terminal width update if css.height less than base.height base.height - base.padding
func WithDisplay ¶
func WithDisplay(d string) func(*cell)
func WithPosition ¶
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.