Documentation
¶
Index ¶
- Constants
- func DiffSGRToNeotex(current, previous *types.SGR) []string
- func DisplayStats(tok types.TokenizerWithStats)
- func ExportFlattenedANSI(width, nblines int, tokens []types.Token, outputEncoding string, ...) (string, int, error)
- func ExportFlattenedANSIInline(width, nblines int, tokens []types.Token, outputEncoding string, ...) (string, int, error)
- func ExportFlattenedNeotex(width, nblines int, tokens []types.Token, crop *types.CropRegion) (string, string, int, error)
- func ExportFlattenedNeotexInline(width, nblines int, tokens []types.Token, crop *types.CropRegion) (string, string, int, error)
- func ExportFlattenedText(width, nblines int, tokens []types.Token, outputEncoding string, ...) (string, int, error)
- func ExportFlattenedTextInline(width, nblines int, tokens []types.Token, outputEncoding string, ...) (string, int, error)
- func ExportPassthroughANSI(tokens []types.Token) (string, error)
- func ExportToInlineNeotex(vt *processor.VirtualTerminal) (string, string)
- func ExportToNeotex(vt *processor.VirtualTerminal) (string, string)
- func ExportTokensToTable(tokens []types.Token, writer io.Writer) error
- func SGRToNeotex(sgr *types.SGR) []string
- func TokensJSON(tok types.TokenizerWithStats)
- type TokenizerJSONOutput
Constants ¶
const NeotexVersion = 1
NeotexVersion is the current version of the neotex format
Variables ¶
This section is empty.
Functions ¶
func DiffSGRToNeotex ¶
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 ¶
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 SGRToNeotex ¶
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"`
}