Archive for April 2015

MSDN Magazine code highlighter

MSDN Magazine has many great articles about all kind of topics you can imagine. The most useful ones talking about the coming versions of C# or .NET for example are a must read.

While the content of the articles is great, the formatting of the code is terrible (non existing actually). The typesetting is inappropriate for code, and the code is simply laid out as simple text, making it extremely hard to read and follow.

People have been asking for formatting on MSDN mag for quite some time without any sign of this happening soon! Here is an example of a page from MSDN Mag:


After trying several chrome extensions that claim to handle syntax highlighting and none of them seemed to work, I have decided to make a small chrome extension that automatically highlights code snippets on MSDN magazine articles.

For this I used https://highlightjs.org/ with jQuery. The extension uses content scripts and have access only to MSDN magazine pages. You can choose among dozens of syntax highlight themes on the fly!

Here is the result without/with the extension installed:




The extension can be downloaded from chrome web store at: [MSDN Magazine code highlighter]

And the source code is obviously available on Github here: https://github.com/martani/MSDN-Magazine-code-highlighter


Swedish Greys - a WordPress theme from Nordic Themepark. Converted by LiteThemes.com.