exporter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const NeotexVersion = 1

NeotexVersion is the current version of the neotex format

Variables

This section is empty.

Functions

func DiffSGRToNeotex

func DiffSGRToNeotex(current, previous *types.SGR) []string

DiffSGRToNeotex generates minimal neotex codes to transition from previous to current SGR state

func DisplayStats

func DisplayStats(tok types.TokenizerWithStats)

func ExportFlattenedANSI

func ExportFlattenedANSI(width, nblines int, tokens []types.Token, outputEncoding string, useVGAColors bool, crop *types.CropRegion) (string, int, error)

ExportFlattenedANSI exports tokens to flattened ANSI format Returns (output, effectiveWidth, error) where effectiveWidth is the VT width after crop

func ExportFlattenedANSIInline

func ExportFlattenedANSIInline(width, nblines int, tokens []types.Token, outputEncoding string, useVGAColors bool, crop *types.CropRegion) (string, int, error)

ExportFlattenedANSIInline flattens ANSI output on a single line. Returns (output, effectiveWidth, error) where effectiveWidth is the VT width after crop

func ExportFlattenedNeotex

func ExportFlattenedNeotex(width, nblines int, tokens []types.Token, crop *types.CropRegion) (string, string, int, error)

ExportFlattenedNeotex exports tokens to neotex format (always UTF-8) Returns (text, sequences, effectiveWidth, error) where effectiveWidth is the VT width after crop

func ExportFlattenedNeotexInline

func ExportFlattenedNeotexInline(width, nblines int, tokens []types.Token, crop *types.CropRegion) (string, string, int, error)

ExportFlattenedNeotexInline exports tokens to inline neotex format (always UTF-8) Returns (text, sequences, effectiveWidth, error) where effectiveWidth is the VT width after crop

func ExportFlattenedText

func ExportFlattenedText(width, nblines int, tokens []types.Token, outputEncoding string, crop *types.CropRegion) (string, int, error)

ExportFlattenedText exports tokens to flattened plain text without styles using a virtual terminal buffer to resolve cursor positioning Returns (text, effectiveWidth, error) where effectiveWidth is the VT width after crop

func ExportFlattenedTextInline

func ExportFlattenedTextInline(width, nblines int, tokens []types.Token, outputEncoding string, crop *types.CropRegion) (string, int, error)

ExportFlattenedTextInline exports tokens to flattened plain text on a single line. Returns (text, effectiveWidth, error) where effectiveWidth is the VT width after crop

func ExportPassthroughANSI

func ExportPassthroughANSI(tokens []types.Token) (string, error)

ExportPassthroughANSI reconstructs ANSI output directly from tokens

func ExportToInlineNeotex

func ExportToInlineNeotex(vt *processor.VirtualTerminal) (string, string)

ExportToInlineNeotex exports the buffer to neotex format, flattening all lines into one.

func ExportToNeotex

func ExportToNeotex(vt *processor.VirtualTerminal) (string, string)

ExportToNeotex exports processor.VirtualTerminal buffer to neotex format with differential encoding. Returns (text, sequences) where: - text is the plain text content - sequences is the neotex format sequences with positions (per line) Uses differential encoding to minimize the number of codes by only outputting changes.

func ExportTokensToTable

func ExportTokensToTable(tokens []types.Token, writer io.Writer) error

func SGRToNeotex

func SGRToNeotex(sgr *types.SGR) []string

SGRToNeotex converts an types.SGR struct to neotex format strings

func TokensJSON

func TokensJSON(tok types.TokenizerWithStats)

Types

type TokenizerJSONOutput

type TokenizerJSONOutput struct {
	Tokens []types.Token    `json:"tokens"`
	Stats  types.TokenStats `json:"stats"`
}

Jump to

Keyboard shortcuts

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