styles

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 4 Imported by: 156

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Abap                = Registry["abap"]
	Algol               = Registry["algol"]
	AlgolNu             = Registry["algol_nu"]
	Arduino             = Registry["arduino"]
	Autumn              = Registry["autumn"]
	Average             = Registry["average"]
	Base16Snazzy        = Registry["base16-snazzy"]
	Borland             = Registry["borland"]
	BlackWhite          = Registry["bw"]
	CatppuccinFrappe    = Registry["catppuccin-frappe"]
	CatppuccinLatte     = Registry["catppuccin-latte"]
	CatppuccinMacchiato = Registry["catppuccin-macchiato"]
	CatppuccinMocha     = Registry["catppuccin-mocha"]
	Colorful            = Registry["colorful"]
	DoomOne             = Registry["doom-one"]
	DoomOne2            = Registry["doom-one2"]
	Dracula             = Registry["dracula"]
	Emacs               = Registry["emacs"]
	Friendly            = Registry["friendly"]
	Fruity              = Registry["fruity"]
	GitHubDark          = Registry["github-dark"]
	GitHub              = Registry["github"]
	GruvboxLight        = Registry["gruvbox-light"]
	Gruvbox             = Registry["gruvbox"]
	HrDark              = Registry["hrdark"]
	HrHighContrast      = Registry["hr_high_contrast"]
	Igor                = Registry["igor"]
	Lovelace            = Registry["lovelace"]
	Manni               = Registry["manni"]
	ModusOperandi       = Registry["modus-operandi"]
	ModusVivendi        = Registry["modus-vivendi"]
	Monokai             = Registry["monokai"]
	MonokaiLight        = Registry["monokailight"]
	Murphy              = Registry["murphy"]
	Native              = Registry["native"]
	Nord                = Registry["nord"]
	OnesEnterprise      = Registry["onesenterprise"]
	ParaisoDark         = Registry["paraiso-dark"]
	ParaisoLight        = Registry["paraiso-light"]
	Pastie              = Registry["pastie"]
	Perldoc             = Registry["perldoc"]
	Pygments            = Registry["pygments"]
	RainbowDash         = Registry["rainbow_dash"]
	RosePineDawn        = Registry["rose-pine-dawn"]
	RosePineMoon        = Registry["rose-pine-moon"]
	RosePine            = Registry["rose-pine"]
	Rrt                 = Registry["rrt"]
	SolarizedDark       = Registry["solarized-dark"]
	SolarizedDark256    = Registry["solarized-dark256"]
	SolarizedLight      = Registry["solarized-light"]
	SwapOff             = Registry["swapoff"]
	Tango               = Registry["tango"]
	Trac                = Registry["trac"]
	Vim                 = Registry["vim"]
	VisualStudio        = Registry["vs"]
	Vulcan              = Registry["vulcan"]
	WitchHazel          = Registry["witchhazel"]
	XcodeDark           = Registry["xcode-dark"]
	Xcode               = Registry["xcode"]
)

Present for backwards compatibility.

Deprecated: use styles.Get(name) instead.

View Source
var Fallback = Registry["swapoff"]

Fallback style. Reassign to change the default fallback style.

View Source
var Registry = func() map[string]*chroma.Style {
	registry := map[string]*chroma.Style{}

	files, err := fs.ReadDir(embedded, ".")
	if err != nil {
		panic(err)
	}
	for _, file := range files {
		if file.IsDir() {
			continue
		}
		r, err := embedded.Open(file.Name())
		if err != nil {
			panic(err)
		}
		style, err := chroma.NewXMLStyle(r)
		if err != nil {
			panic(err)
		}
		registry[style.Name] = style
		_ = r.Close()
	}
	return registry
}()

Registry of Styles.

Functions

func Get

func Get(name string) *chroma.Style

Get named style, or Fallback.

func Names

func Names() []string

Names of all available styles.

func Register

func Register(style *chroma.Style) *chroma.Style

Register a chroma.Style.

Types

This section is empty.

Jump to

Keyboard shortcuts

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