highlighter

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(data *[]byte, chars []rune) error

Encode appends the UTF-8 encoding of a slice of runes to the provided byte slice.

Parameters:

  • data: A pointer to a byte slice where the encoded UTF-8 bytes will be appended.
  • chars: A slice of runes to encode.

Returns:

  • error: An error if the provided data parameter is nil.

func Highlight

func Highlight(h Highlighter, lexer sllx.Lexer, data []byte) ([]byte, error)

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (Builder) Build

func (b Builder) Build() Highlighter

func (*Builder) Register

func (b *Builder) Register(type_ string, style *colors.Style) error

func (*Builder) Reset

func (b *Builder) Reset()

type Highlighter

type Highlighter struct {
	// contains filtered or unexported fields
}

func (Highlighter) Highlight

func (h Highlighter) Highlight(w io.Writer, data []rune, tokens []*slgr.Token) error

Jump to

Keyboard shortcuts

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