static

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package static renders JSON node trees to the terminal with syntax highlighting and optional annotation overlays (stats, merkle hashes).

Index

Constants

This section is empty.

Variables

View Source
var (
	Cyber   = themeFromPalette(theme.PaletteCyber)
	Matrix  = themeFromPalette(theme.PaletteMatrix)
	Dracula = themeFromPalette(theme.PaletteDracula)
	Nord    = themeFromPalette(theme.PaletteNord)
)

Functions

func Boot

func Boot(w io.Writer, filename string, opts Options) func(nodeCount int, elapsed time.Duration)

Boot prints the neural-interface boot sequence to stderr. Call before Render. Suppressed when opts.Quiet is true.

func Render

func Render(w io.Writer, root *node.Node, opts Options) error

Render writes a colorized JSON tree to w.

func RenderError

func RenderError(w io.Writer, err error, opts Options)

RenderError prints a formatted error to w.

Types

type Options

type Options struct {
	Theme        Theme
	ShowStats    bool
	ShowMerkle   bool
	ShowLineNums bool
	Compact      bool
	Quiet        bool
	NoColor      bool
	Filename     string
}

Options controls rendering behaviour.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns sensible defaults.

type Theme

type Theme struct {
	ObjectKey   lipgloss.Style
	ArrayIndex  lipgloss.Style
	StringVal   lipgloss.Style
	NumberVal   lipgloss.Style
	BoolVal     lipgloss.Style
	NullVal     lipgloss.Style
	Punctuation lipgloss.Style
	LineNumber  lipgloss.Style
	HashTag     lipgloss.Style
	StatTag     lipgloss.Style
	ErrorStyle  lipgloss.Style
	Banner      lipgloss.Style
	BannerOK    lipgloss.Style
}

Theme holds the color palette for static rendering.

func ResolveTheme added in v1.0.0

func ResolveTheme(name string) Theme

ResolveTheme returns the named theme, defaulting to Cyber.

Jump to

Keyboard shortcuts

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