styles

package
v0.0.0-...-ea0b158 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT, MIT, OFL-1.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = sync.OnceValue(func() map[string]*chroma.Style {
	registry := map[string]*chroma.Style{}
	files, err := fs.ReadDir(embedded, ".")
	if err != nil {
		panic(err)
	}
	for _, file := range files {
		r, err := embedded.Open(file.Name())
		if err != nil {
			panic(err)
		}
		style, err := chroma.NewXMLStyle(r)
		if err != nil {
			panic(err)
		}
		registry[strings.ToLower(style.Name)] = style
		_ = r.Close()
	}
	return registry
})

Registry of Styles, built on first use.

Functions

func Fallback

func Fallback() *chroma.Style

Fallback style.

func Get

func Get(name string) *chroma.Style

Get named style, or Fallback.

func Names

func Names() []string

Names of all available styles.

Types

This section is empty.

Jump to

Keyboard shortcuts

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