Posts

Showing posts with the label syntax highligting

New syntax highlighter: PrismJS

Spanish version / Versión en Español Who would have thought that this blog would live long enough to see a third change of syntax highlighter? Incredibly enough, Blogger is also alive and kicking. This site's administration has decided to retire highlightjs , which seems to be still alive, but has lost ground to prismjs . Obviously, it's subjective, but personally I have decided to favor Prism due to the following reasons: It managed to handle VB.NET code blocks better. Yes, I know it's not the most modern language, but we still hold some affection for it. It looks better: it's more compact, with a better color selection. It also highlights more keywords, at least for the languages we use here. It offers an extensible architecture, including a plugin system which allows, for example, adding line numbers. HighlighJS has no such feature. All of these extra features, and still Prism has a very small footprint. Without fu...

Blog renewal and cleanup - New syntax highlighting

Spanish version / Versión en Español After switching to a more modern Blogger theme, I lost the syntax highlighting provided by Alex Gorbatchev's Syntax Highlighter , a project which is still alive and kicking but for some reason, doesn't play nice with Blogger's dynamic themes. Researching a bit, I stumbled upon Highlight JS , and I liked its simplicity and versatily. It lacks line numbers, but as the author explains , they are not a deal breaker and the code looks very nice. To install and use Highlight JS on Blogger, 3 simple steps are required: Go to Theme-Edit HTML and add links to Highlight JS' CSS and JS files inside <head>. For example, using CDNJS links for version 9.10: <link href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/tomorrow-night.min.css' rel='stylesheet'/> <script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js'/> I am using a c...