Skip to content

Commit

Permalink
helpers: Add Chroma styles to docs.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored and bep committed Feb 7, 2025
1 parent a352e69 commit f0c1852
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
71 changes: 70 additions & 1 deletion docs/data/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1737,7 +1804,9 @@ config:
headers: null
redirects:
- force: false
from: '**'
from: /**
fromHeaders: null
fromRe: ""
status: 404
to: /404.html
services:
Expand Down
6 changes: 5 additions & 1 deletion helpers/docshelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"sort"

"github.com/alecthomas/chroma/v2/lexers"
"github.com/alecthomas/chroma/v2/styles"
"github.com/gohugoio/hugo/docshelper"
)

Expand All @@ -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)
Expand Down

0 comments on commit f0c1852

Please sign in to comment.