Documentation
¶
Index ¶
Constants ¶
const DefaultTheme = "github-dark"
DefaultTheme is the chroma theme name used when none is configured. It is shared with CSSForTheme so the class output and the generated CSS agree.
Variables ¶
This section is empty.
Functions ¶
func AvailableThemes ¶
func AvailableThemes() []string
AvailableThemes returns a list of built-in chroma theme names.
func CSSForTheme ¶
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 ¶
Highlight returns HTML with CSS class annotations for the given code and language, using the default theme. Callers that know the configured code theme should use HighlightTheme so the emitted classes match the CSS.
func HighlightTheme ¶ added in v0.4.0
HighlightTheme is Highlight with an explicit chroma theme. The theme affects the token->class mapping, so it must match the stylesheet produced by CSSForTheme or the highlighted code is styled (or unstyled) incorrectly.
func NormalizeLanguage ¶
NormalizeLanguage normalizes common language aliases to chroma lexer names.
Types ¶
This section is empty.