Created
December 27, 2017 10:35
-
-
Save mahedi2014/3acfd11b4948548f1162bff8881777e5 to your computer and use it in GitHub Desktop.
Syntax highlight with js library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Add this before </body> | |
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script> | |
2. Encapsulate your code block with <pre> tag and the "prettyprint" class | |
<pre class="prettyprint"> | |
$(function() { | |
alert('I am using Prettify as Syntax Highlighter'); | |
}); | |
</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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment