Archives for Saturday, January 14, 2017

January 2017 (3)
SMTWTFS
« Dec Feb »
1234567
891011121314
15161718192021
22232425262728
293031

Like this Archive Calendar widget? Download it here.


Automating the pasting of code in blog posts

So, just before Christmas, I switched to using a client-side library to highlight the code in my blog posts . The library I chose was Prism JS , and it works by marrying up some JavaScript and CSS to specially decorated pre and code elements so that their content (the code itself) is highlighted nicely. Specially decorated? Yep, it looks like this in the HTML: <div class="jmbcodeblock"> <pre><code class="language-foo"> _the code to be shown highlighted_ </code></pre>...

READ MORE