You can download it here.
If you don't have a place to upload, you can use the free hosted version listed here. 2. Link to CSS and Javascript
Open your webpage's HTML file and add links to the SyntaxHighlighter's CSS and JavaScript files. For optimal results, place these lines at the very end of your page, just before the closing body tag.
<link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css"></link> <link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css"></link> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js"></script> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shLegacy.js"></script> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js"></script> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js"></script> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"></script> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js"></script> <script type="text/javascript"> SyntaxHighlighter.config.bloggerMode = true; SyntaxHighlighter.all(); </script>It is not necessary to add the js files for all languages - just for the ones you will be using. 3. Add Code
Now add the code you wish to highlight in your webpage, surrounded by the
<pre>
tag. Set the class
attribute to the language alias e.g. brush:java
<pre title="Test SyntaxHighlighter 3" class="brush: java;"> public void printHello(){ System.out.println("Hello World"); } </pre>4. View Page
View the webpage in your browser and you should see your syntax highlighted code snippet as:
public void printHello(){ System.out.println("Hello World"); }
This comment has been removed by the author.
ReplyDeleteThanks man it was very easy to understand. After a 100's of page searches i done it by your blog. I am going to bookmark this blog. Welldone... Good Job!
ReplyDelete