Wednesday, September 10, 2025

Formatting code in Blogger

I have been using Github gists to share code and I have no plan of abandoning it. For smaller/one liners, I sometimes use div element with inline CSS.

I have been exploring formatting my code directly in Blogger but it is mostly hit and miss. I came accross highlight.js and I am impressed with the result.

Below is a quick guide how to format code using highlight.js:
  1. Open blogger template
  2. Before the <head> element, add the following
  3. In the post itself, soround the code like:

No comments:

SBCL Hello world

SBCL Hello, world! Version info: - OS: Windows 11 23H2 (Microsoft Windows [Version 10.0.22631.7079]) - Emacs: 30.2 - SBCL : 2.6.4 - SLI...