Chroma Syntax Highlighting via Caddy 0 ▲ nuxx.net 1 hour ago · Tech · hide · 0 comments Chroma (via Caddy) highlighting ESPHome YAML. After learning that Chroma is how Caddy renders Markdown into HTML, I started thinking it’d be neat to use Chroma to do viewing with styling/syntax highlighting of any supported files that I share/archive at nuxx.net/files. As I began investigating this, thinking that I’d have to do some sort of server-side rendering fed back to the webserver, it turned out there is a great hack that made it a lot simpler: Use the built-in Markdown support to render only code block with the contents of each file. I’m impressed with how this worked out. With some Caddyfile changes to call this, an updated custom file browser, and the HTML template (yes, all AI-assisted development) supported files in my archive get a nice VIEW button next to them which opens them in the viewer, or I can link directly to them with a ?viewer argument. Adding an hl= argument will (eg: hl=19 or hl=10-15 or some comma-separated combination thereof) will highlight individual… No comments yet. Log in to reply on the Fediverse. Comments will appear here.