prettycode

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode is the type of the mode

const (
	// HtmlMode is the mode for html
	HtmlMode Mode = iota
	// ConsoleMode is the mode for console
	ConsoleMode
)

type PrettyCode

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

PrettyCode is a struct that holds the tokens of the code

func New

func New(r io.Reader) (*PrettyCode, error)

func NewToken

func NewToken(ts []*models.Token) *PrettyCode

NewToken creates a new PrettyCode struct from tokens

func (*PrettyCode) HighlightConsole

func (p *PrettyCode) HighlightConsole() string

HighlightConsole highlights the code with console

func (*PrettyCode) HighlightHtml

func (p *PrettyCode) HighlightHtml() string

HighlightHtml highlights the code with html tags

Jump to

Keyboard shortcuts

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