Splash
:ocean: Syntax highlight code embedded in HTML with a splash of color. Also includes the auto-updated Chroma style gallery.
Install / Use
/learn @xyproto/SplashREADME
Splash
Syntax highlight code embedded in HTML with a splash of color by using the chroma package.
The generated output is tested by visual inspection in Chromium, Midori and Netsurf.
Example usage
package main
import (
"os"
"github.com/xyproto/splash"
)
func main() {
// Read "input.html"
inputHTML, err := os.ReadFile("input.html")
if err != nil {
panic(err)
}
// Highlight the source code in the HTML document with the monokai style
outputHTML, err := splash.Splash(inputHTML, "monokai")
if err != nil {
panic(err)
}
// Write the highlighted HTML to "output.html"
if err := os.WriteFile("output.html", outputHTML, 0644); err != nil {
panic(err)
}
}
Available syntax highlighting styles
See the Style Gallery for a full overview of available styles and how they may appear.
General information
- Version: 1.3.1
- License: BSD-3
- Author: Alexander F. Rødseth <xyproto@archlinux.org>
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.5kCommit, push, and open a PR
