Jump to Docs Navigation
Dave Rupert has a new syntax highlighter: MicroLighter . He wrote about the why . There are a bunch of trade-offs with all the technologies that do this job. The trade-offs here seem pretty worth it for a relatively lightweight, infrequent syntax highlighting job. I mean 2 KB as a base library is pretty amazing, with the languages coming in even smaller. I generated a demo and fiddled around with it a little just to show it works super well on CodePen, naturally.
My favorite part about MicroLighter is how it uses the web’s Highlight API , a feature I was pretty into exploring about a year ago. The idea that it “doesn’t touch the DOM” is kind of amazing to me. I also like how Dave, as the President of Web Components, made it available as <micro-lighter> . I feel like a lot of projects like this would have gone straight for a React component or other framework-specific implementations. Dave can confidently say: you don’t need that, this will work everywhere.…