Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render a HTML string and returns a styled string suitable for terminal output. Supported elements and class names are documented in the README.
func RenderToString ¶
Types ¶
type Element ¶
type Element struct {
Tag Tag
Classes []string
Attrs map[string]string
Style Style
Children []*Element
Content string
Parent *Element
}
Element represents a single node in the parsed element tree. Tag identifies the HTML element type, Style holds the resolved visual properties, and Children contains nested elements.
type Style ¶
type Style struct {
PaddingLeft int
PaddingRight int
PaddingTop int
PaddingBottom int
MarginLeft int
MarginRight int
MarginTop int
MarginBottom int
Bold bool
Italic bool
Underline bool
Strikethrough bool
TextTransform string
ForegroundColor string
BackgroundColor string
Truncate bool
MaxWidth int
MinWidth int
}
func ParseClasses ¶
Click to show internal directories.
Click to hide internal directories.