«    »

Syntax Highlighting on the Web

I have finally added syntax highlighting to my website using Google Code Prettify. My code examples will now be nicely colored based on syntax. Integrated development environments have been doing this for at least ten years. When I was first introduced to syntax highlighting in IDEs I found it a tremendous productivity boost for reading and understanding code, so it only makes sense to have the same benefits available when reading code snippets online.

This has been on my to-do list for a while, but I was never satisfied with the libraries I found. (I mostly looked for WordPress plug-ins, since this site is based on WordPress.) I then came across a recommendation by Software By Rob for the Google Code Prettify library and immediately liked how simple it was to use: basically just one stylesheet and one javascript file.

To see some examples of the syntax highlighting at work check out the following articles:

If you find this article helpful, please make a donation.

«    »