exporter

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NeotexVersion = "0.13.0" // x-release-please-version

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, legacyMode bool, crop *types.CropRegion, keepTrailing bool) (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, legacyMode bool, crop *types.CropRegion, keepTrailing bool) (string, int, error)

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

func ExportFlattenedANSIInlineWithSauce added in v0.3.0

func ExportFlattenedANSIInlineWithSauce(width, nblines int, tokens []types.Token, outputEncoding string, useVGAColors bool, legacyMode bool, crop *types.CropRegion, sauce *types.Sauce, keepTrailing bool) (string, int, error)

ExportFlattenedANSIInlineWithSauce exports tokens to single-line ANSI format with SAUCE metadata appended. If sauce is nil, behaves identically to ExportFlattenedANSIInline. Returns (output, effectiveWidth, error) where effectiveWidth is the VT width after crop.

func ExportFlattenedANSIWithSauce added in v0.3.0

func ExportFlattenedANSIWithSauce(width, nblines int, tokens []types.Token, outputEncoding string, useVGAColors bool, legacyMode bool, crop *types.CropRegion, sauce *types.Sauce, keepTrailing bool) (string, int, error)

ExportFlattenedANSIWithSauce exports tokens to flattened ANSI format with SAUCE metadata appended. If sauce is nil, behaves identically to ExportFlattenedANSI. When dimensions are missing in the SAUCE record, content bounds are used to fill them. 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, keepTrailing bool) (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, keepTrailing bool) (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 ExportFlattenedNeotexInlineWithSauce added in v0.3.0

func ExportFlattenedNeotexInlineWithSauce(width, nblines int, tokens []types.Token, crop *types.CropRegion, sauce *types.Sauce, keepTrailing bool) (string, string, int, error)

ExportFlattenedNeotexInlineWithSauce exports tokens to inline neotex format with SAUCE metadata. Returns (text, sequences, effectiveWidth, error) where effectiveWidth is the VT width after crop. If sauce is nil, behaves identically to ExportFlattenedNeotexInline.

func ExportFlattenedNeotexWithSauce added in v0.3.0

func ExportFlattenedNeotexWithSauce(width, nblines int, tokens []types.Token, crop *types.CropRegion, sauce *types.Sauce, keepTrailing bool) (string, string, int, error)

ExportFlattenedNeotexWithSauce exports tokens to neotex format with SAUCE metadata on the last line. Returns (text, sequences, effectiveWidth, error) where effectiveWidth is the VT width after crop. If sauce is nil, behaves identically to ExportFlattenedNeotex.

func ExportFlattenedText

func ExportFlattenedText(width, nblines int, tokens []types.Token, outputEncoding string, crop *types.CropRegion, keepTrailing bool) (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. When keepTrailing is true, trailing empty lines are preserved.

func ExportFlattenedTextInline

func ExportFlattenedTextInline(width, nblines int, tokens []types.Token, outputEncoding string, crop *types.CropRegion, keepTrailing bool) (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. The keepTrailing flag is ignored for inline output.

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, error)

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

func ExportToNeotex

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

ExportToNeotex exports processor.VirtualTerminal buffer to neotex format with differential encoding. Returns (text, sequences, error) 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 HyperlinkToNeotex added in v0.4.0

func HyperlinkToNeotex(h *types.Hyperlink) string

HyperlinkToNeotex converts a Hyperlink to neotex format. Returns "HL:<url>" for hyperlink ON or "Hl" for hyperlink OFF.

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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