syntaxcolor

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

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

Color specifies a foreground and background color.

type LineColor

type LineColor struct {
	Fg, Bg     termbox.Attribute
	Start, End int
}

LineColor object maps a color pair (bg, fg) with start/end indices within a string.

type SyntaxRule

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

SyntaxRule simply maps a regexp to a color.

type SyntaxRules

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

SyntaxRules is the full collection of all syntax rules.

func NewSyntaxRules

func NewSyntaxRules(cfg config.Config) *SyntaxRules

NewSyntaxRules creates a new SyntaxRules object, and initializes the syntax rule sets.

func (SyntaxRules) Colorize

func (rules SyntaxRules) Colorize(str string) []LineColor

Colorize takes in a string and outputs an array of LineColor objects.

Jump to

Keyboard shortcuts

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