The Highlight.js logo
Contributing to Highlight.js
(Updated )
by Steven Van Impe


For this year's holiday project, I worked on improving Swift support in Highlight.js.

Highlight.js is a popular framework for syntax highlighting in websites. I often rely on it because it's simple to integrate into a writing/publishing setup. However, its Swift support was quite basic and I encountered many issues with it, so I ended up rewriting and expanding it significantly.

Some of the areas I worked on are:

These improvements are released in versions 10.5 and 10.6. I've also added a large test suite, to help catch regressions in future versions.

For more information, see the useful links below.


At WWDC '21, Apple announced Swift-DocC, a new documentation compiler for Swift frameworks and packages. DocC renders its output using Vue.js and relies on Highlight.js for syntax highlighting. I first noticed this on the SwiftUI Tutorials, which are built using DocC but predate its open source release.

Suffice to say, I'm happy to see my work reach so many Swift developers. My contributions made a much bigger impact than I had anticipated, and I feel proud to have indirectly contributed to Swift-DocC and SwiftUI.

Useful links