diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 18:26:51 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 18:26:51 +0800 |
commit | 4f4f6a25be2625b4bb2cb10e3520f52c4a35c243 (patch) | |
tree | 5458da1ee5efa5e46e831c34c1f39ebc67fb71b0 /render/chroma.go | |
parent | Remove renderReadmeAtTree (diff) | |
download | forge-4f4f6a25be2625b4bb2cb10e3520f52c4a35c243.tar.gz forge-4f4f6a25be2625b4bb2cb10e3520f52c4a35c243.tar.zst forge-4f4f6a25be2625b4bb2cb10e3520f52c4a35c243.zip |
Separate code/README rendering and unsafe to their own packages
Diffstat (limited to '')
-rw-r--r-- | render/chroma.go (renamed from chroma.go) | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chroma.go b/render/chroma.go index 0d904b7..c7d64ec 100644 --- a/chroma.go +++ b/render/chroma.go @@ -1,4 +1,4 @@ -package main +package render import ( "bytes" @@ -9,7 +9,7 @@ import ( chromaStyles "github.com/alecthomas/chroma/v2/styles" ) -func renderHighlightedFile(filename, content string) template.HTML { +func Highlight(filename, content string) template.HTML { lexer := chromaLexers.Match(filename) if lexer == nil { lexer = chromaLexers.Fallback |