syntaxhighlight

package
v0.3.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableThemes

func AvailableThemes() []string

AvailableThemes returns a list of built-in chroma theme names.

func CSSForTheme

func CSSForTheme(theme string) string

CSSForTheme returns the CSS stylesheet for the given chroma theme name. The returned CSS targets the class-based output from the HTML formatter.

func Highlight

func Highlight(code string, lang string) string

Highlight returns HTML with CSS class annotations for the given code and language. If lang is empty or unrecognized, the code is returned HTML-escaped as plain text. Returns only the inner token spans — callers wrap in <pre>/<code> as needed.

func NormalizeLanguage

func NormalizeLanguage(lang string) string

NormalizeLanguage normalizes common language aliases to chroma lexer names.

Types

This section is empty.

Jump to

Keyboard shortcuts

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