Code Highlighting in Jekyll Finally!

Finally! I’ve been trying to get Jekyll code highlighting working since I first ported my blog. Earlier documentation says you have to install stuff which later ones said is wrong. “It just works” they say. Yet when I tried to get it working it always came up with nada! The documentation left out one really important part…the style sheets. It’s sad how long I went back and forth with this to have it simply be the equivalent of “is it plugged in”!

It makes sense that the style sheets for code highlighting don’t exist out of the box I suppose. We all have different preferences, which is why one has to choose to load it separately. Jekyll is used for non-software type blogs all the time as well. The code literal blocks “worked” in so far as they showed text in a monospace font with a bounding box and background but it just didn’t do any syntax highlighting. Now that’s been solved. It’s literally as simple as just including a style sheet and the syntax highlighting will do what I need. Thankfully there are some good sources of syntax highlighting CSS’s. I pulled one from the Pygments Website. For the list of supported languages check out this link as well. Sadly old fashioned BASIC wasn’t one of them so that text looks the same but the others all should have some decent syntax highlighting now!



Picture of Me (Hank)

Categories

Updates (124)
Journal (115)
Software Engineering (96)
Daily Updates (84)
Commentary (66)
Methodology (57)

Archive

2019
2018
2017
2016
2015
2014
2013