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:

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 ...