1. Go to Dashboard > Design > Edit HTML
2. Backup your template. In case, there is something wrong, you can backup your template.
3. Put the following code before the </head> tag.
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/> <script language='javascript' type='text/javascript'> SyntaxHighlighter.config.bloggerMode = true; SyntaxHighlighter.all(); </script>
4. Save change.
In the above code, I use shBrushXml.js and shBrushCss.js. For the full list of supported language, follow here. The letter follow Brush is the language. So if you want to have C#, then shBrushCSharp.js is for you.You just have to replace the one that you use with the one in the bolded code above.
In order to use it, first you have to convert all "<" and ">" to < and > respectively.
Then put your source code into this code
<pre class="brush: html"; [optional_params]"> your code here </pre>
I use xml file. Thus, I put html above. If you use c++, you should put cpp instead of html.
That is all the basic that you need to make it work. For more advance setting, you can check it here
0 comments:
Why not leave a comment? No matter what, I'd love to hear from you!
Post a Comment