render

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJSONChildren

func BuildJSONChildren(v any, depth int, orderedKeys []string, rawJSON ...[]byte) []*line.LogLine

BuildJSONChildren creates child LogLines for an expanded JSON value. orderedKeys provides the key order for objects. rawJSON is the original JSON bytes used to extract nested key order.

func RenderExpanded

func RenderExpanded(l *line.LogLine, width int, cursorPath []int, wrapMode bool, styles *Styles) ([]string, int)

RenderExpanded renders a line and its children when expanded. When wrapMode is true, all children are wrapped. The cursor child (identified by cursorPath) always wraps regardless of wrapMode. Returns the rendered rows and the 0-based index of the cursor row (-1 if no cursor in this tree).

func RenderLine

func RenderLine(l *line.LogLine, width int, isCursor bool, styles *Styles) string

RenderLine renders a single LogLine to a string.

func RenderLineWrapped

func RenderLineWrapped(l *line.LogLine, width int, isCursor bool, wrap bool, styles *Styles) []string

RenderLineWrapped renders a single LogLine, returning multiple visual rows if wrap is true. When isCursor is true, the line is always shown unwrapped (full content visible) regardless of the global wrap setting.

func VisualHeight

func VisualHeight(l *line.LogLine, width int, wrap bool, styles *Styles) int

VisualHeight returns how many terminal rows a line will occupy at the given width. If wrap is false, always returns 1. If wrap is true, computes based on content width.

func WrapLine

func WrapLine(s string, width int) []string

WrapLine wraps a rendered line into multiple visual rows of the given width. Returns the wrapped rows. If the line fits, returns a single-element slice.

Types

type Styles

type Styles struct {
	CursorLine lipgloss.Style

	JSONKey    lipgloss.Style
	JSONString lipgloss.Style
	JSONNumber lipgloss.Style
	JSONBool   lipgloss.Style
	JSONNull   lipgloss.Style
	JSONBrace  lipgloss.Style

	DiffAdd    lipgloss.Style
	DiffRemove lipgloss.Style
	DiffHunk   lipgloss.Style
	DiffHeader lipgloss.Style

	GoTestPass     lipgloss.Style
	GoTestFail     lipgloss.Style
	GoTestSkip     lipgloss.Style
	GoTestRun      lipgloss.Style
	GoTestDuration lipgloss.Style

	WarnPrefix  lipgloss.Style
	ErrorPrefix lipgloss.Style
	InfoPrefix  lipgloss.Style
	DebugPrefix lipgloss.Style

	Timestamp       lipgloss.Style
	Datetime        lipgloss.Style
	SourceRef       lipgloss.Style
	K8sResource     lipgloss.Style
	K8sEventNormal  lipgloss.Style
	K8sEventWarning lipgloss.Style

	LevelError lipgloss.Style
	LevelWarn  lipgloss.Style
	LevelInfo  lipgloss.Style
	LevelDebug lipgloss.Style
	NginxField lipgloss.Style
	IPAddr     lipgloss.Style
	FailedStep lipgloss.Style

	TableHeader lipgloss.Style
	TableCell   lipgloss.Style
	TableSep    lipgloss.Style

	StderrGutter    lipgloss.Style
	ExpandIndicator lipgloss.Style

	SearchMatch lipgloss.Style
	Plain       lipgloss.Style
}

Styles holds all style definitions used by renderers.

Jump to

Keyboard shortcuts

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