helpers: Add Chroma styles to docs.yaml

Closes #13360
This commit is contained in:
Joe Mooring 2025-02-07 11:06:29 -08:00 committed by Bjørn Erik Pedersen
parent a352e69b02
commit f0c1852978
2 changed files with 75 additions and 2 deletions

View file

@ -958,6 +958,73 @@ chroma:
- Aliases:
- zig
Name: Zig
styles:
- abap
- algol
- algol_nu
- arduino
- autumn
- average
- base16-snazzy
- borland
- bw
- catppuccin-frappe
- catppuccin-latte
- catppuccin-macchiato
- catppuccin-mocha
- colorful
- doom-one
- doom-one2
- dracula
- emacs
- evergarden
- friendly
- fruity
- github
- github-dark
- gruvbox
- gruvbox-light
- hr_high_contrast
- hrdark
- igor
- lovelace
- manni
- modus-operandi
- modus-vivendi
- monokai
- monokailight
- murphy
- native
- nord
- nordic
- onedark
- onesenterprise
- paraiso-dark
- paraiso-light
- pastie
- perldoc
- pygments
- rainbow_dash
- rose-pine
- rose-pine-dawn
- rose-pine-moon
- rrt
- solarized-dark
- solarized-dark256
- solarized-light
- swapoff
- tango
- tokyonight-day
- tokyonight-moon
- tokyonight-night
- tokyonight-storm
- trac
- vim
- vs
- vulcan
- witchhazel
- xcode
- xcode-dark
config:
HTTPCache:
cache:
@ -1737,7 +1804,9 @@ config:
headers: null
redirects:
- force: false
from: '**'
from: /**
fromHeaders: null
fromRe: ""
status: 404
to: /404.html
services:

View file

@ -4,6 +4,7 @@ import (
"sort"
"github.com/alecthomas/chroma/v2/lexers"
"github.com/alecthomas/chroma/v2/styles"
"github.com/gohugoio/hugo/docshelper"
)
@ -30,7 +31,10 @@ func init() {
}
return docshelper.DocProvider{"chroma": map[string]any{"lexers": chromaLexers}}
return docshelper.DocProvider{"chroma": map[string]any{
"lexers": chromaLexers,
"styles": styles.Names(),
}}
}
docshelper.AddDocProviderFunc(docsProvider)