Syntax highlight with js library
Wednesday, December 27, 2017
To highlight syntax you have to follow:
Add this before </body>:
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
Encapsulate your code block with css class "prettyprint":
<pre class="prettyprint"><code> ---Your code will here ---</code></pre>
You can also define different styles
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=desert"></script>
List of styles available - http://google-code-prettify.googlecode.com/svn/trunk/styles/index.html
To get more information go https://gist.github.com/mahedi2014/3acfd11b4948548f1162bff8881777e5
Labels: HOW-TO
Post a Comment