Tuesday, July 3, 2018

Highlight Embedded Code on your html page

Copy following in the head section

1234<link rel="stylesheet"
      href="http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/default.min.css">
<script src="http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

The code that needs highlighting should be in the following form,

12345<pre class="language"><code>
...
code
...
</code></pre>