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 ExportFlattenedANSIInlineWithSauce(width, nblines int, tokens []types.Token, outputEncoding string, ...) (string, int, error)
- func ExportFlattenedANSIWithSauce(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 ExportFlattenedNeotexInlineWithSauce(width, nblines int, tokens []types.Token, crop *types.CropRegion, ...) (string, string, int, error)
- func ExportFlattenedNeotexWithSauce(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 HyperlinkToNeotex(h *types.Hyperlink) string
- func SGRToNeotex(sgr *types.SGR) []string
- func TokensJSON(tok types.TokenizerWithStats)
- type TokenizerJSONOutput
Constants ¶
const NeotexVersion = "1.0.0" // x-release-please-version
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, legacyMode 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, legacyMode 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 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) (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) (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) (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 ExportFlattenedNeotexInlineWithSauce ¶ added in v0.3.0
func ExportFlattenedNeotexInlineWithSauce(width, nblines int, tokens []types.Token, crop *types.CropRegion, sauce *types.Sauce) (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) (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) (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 HyperlinkToNeotex ¶ added in v0.4.0
HyperlinkToNeotex converts a Hyperlink to neotex format. Returns "HL:<url>" for hyperlink ON or "Hl" for hyperlink OFF.
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"`
}