highlight

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 18 Imported by: 237

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code added in v1.13.0

func Code(fileName, language, code string) (output template.HTML, lexerName string)

Code returns a HTML version of code string with chroma syntax highlighting classes and the matched lexer name

func CodeFromLexer added in v1.15.4

func CodeFromLexer(lexer chroma.Lexer, code string) template.HTML

CodeFromLexer returns a HTML version of code string with chroma syntax highlighting classes

func File added in v1.13.0

func File(fileName, language string, code []byte) ([]template.HTML, string, error)

File returns a slice of chroma syntax highlighted HTML lines of code and the matched lexer name

func NewContext

func NewContext()

NewContext loads custom highlight map from local config

func PlainText added in v1.17.4

func PlainText(code []byte) []template.HTML

PlainText returns non-highlighted HTML for code

Types

This section is empty.

Jump to

Keyboard shortcuts

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