widgets

package
v0.0.0-...-d4e95cc Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectText

func CollectText(n ast.Node, source []byte) string

func NewRootWidget

func NewRootWidget(s Slide, windowWidth, windowHeight int) vxfw.Widget

func SetInlineTheme

func SetInlineTheme(theme theming.ModeTheme)

Types

type BlockquoteWidget

type BlockquoteWidget struct {
	Paragraphs []TextWidget
}

func NewBlockquote

func NewBlockquote(n ast.Node, source []byte, theme theming.ModeTheme) *BlockquoteWidget

func (*BlockquoteWidget) Draw

func (*BlockquoteWidget) Xml

func (w *BlockquoteWidget) Xml() XmlNode

type CodeBlockWidget

type CodeBlockWidget struct {
	Code   string
	Lang   string
	Syntax theming.SyntaxTheme
	Style  vaxis.Style
}

func NewCodeBlock

func NewCodeBlock(n ast.Node, source []byte, theme theming.ModeTheme) *CodeBlockWidget

func (*CodeBlockWidget) Draw

func (*CodeBlockWidget) Xml

func (w *CodeBlockWidget) Xml() XmlNode

type HeadingWidget

type HeadingWidget struct {
	Text TextWidget
}

func NewHeading

func NewHeading(h *ast.Heading, source []byte, theme theming.ModeTheme) *HeadingWidget

func (*HeadingWidget) Draw

func (w *HeadingWidget) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (*HeadingWidget) Xml

func (w *HeadingWidget) Xml() XmlNode

type ImageWidget

type ImageWidget struct {
	Path       string
	AltText    string
	CellWidth  int
	CellHeight int
	Style      vaxis.Style
}

func NewImageWidget

func NewImageWidget(image *ast.Image, source []byte, theme theming.ModeTheme) *ImageWidget

func (*ImageWidget) Draw

func (w *ImageWidget) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (*ImageWidget) Xml

func (w *ImageWidget) Xml() XmlNode

type ListItem

type ListItem struct {
	Blocks []ListItemBlock
}

type ListItemBlock

type ListItemBlock struct {
	Segments []vaxis.Segment
	Sublist  *ListWidget
}

type ListWidget

type ListWidget struct {
	Ordered bool
	Start   int
	Depth   int
	Items   []ListItem
	// contains filtered or unexported fields
}

func NewList

func NewList(l *ast.List, source []byte, theme theming.ModeTheme) *ListWidget

func (*ListWidget) Draw

func (w *ListWidget) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (*ListWidget) Xml

func (w *ListWidget) Xml() XmlNode

type ParagraphWidget

type ParagraphWidget struct {
	Text TextWidget
}

func NewParagraph

func NewParagraph(n ast.Node, source []byte, theme theming.ModeTheme) *ParagraphWidget

func (*ParagraphWidget) Draw

func (*ParagraphWidget) Xml

func (w *ParagraphWidget) Xml() XmlNode

type Slide

type Slide struct {
	Widgets []vxfw.Widget
}

func NewSlide

func NewSlide(nodes []ast.Node, source []byte, theme theming.ModeTheme) Slide

type StatusWidget

type StatusWidget struct {
	Text        string
	WindowWidth int
	Style       vaxis.Style
}

func (*StatusWidget) Draw

func (w *StatusWidget) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (*StatusWidget) Xml

func (w *StatusWidget) Xml() XmlNode

type TableWidget

type TableWidget struct {
	HasHeader bool
	Rows      [][]string
	Theme     theming.TableTheme
}

func NewTable

func NewTable(n ast.Node, source []byte, theme theming.ModeTheme) *TableWidget

func (*TableWidget) Draw

func (w *TableWidget) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (*TableWidget) Xml

func (w *TableWidget) Xml() XmlNode

type TextWidget

type TextWidget struct {
	Segments []vaxis.Segment
	Softwrap bool
}

func NewStyledText

func NewStyledText(n ast.Node, source []byte, baseStyle vaxis.Style) TextWidget

func NewText

func NewText(n ast.Node, source []byte) TextWidget

func (TextWidget) Draw

func (w TextWidget) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)

func (TextWidget) SegmentsXml

func (w TextWidget) SegmentsXml() []XmlNode

func (TextWidget) Xml

func (w TextWidget) Xml() XmlNode

type XmlNode

type XmlNode struct {
	XMLName  xml.Name
	Attrs    []xml.Attr `xml:",attr"`
	Children []XmlNode  `xml:",any"`
	Text     string     `xml:",chardata"`
}

type Xmler

type Xmler interface {
	Xml() XmlNode
}

Jump to

Keyboard shortcuts

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