- Go to Layout -> Edit HTML
- Add the following lines right before </head>
<link href='http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/> <script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js'/> <script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js'/> - Add the following lines right before </body>
<script language="javascript">
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
- Save the template. Then you are done.
How to publish source code?
- Type your article as usual.
- Copy your code to here.
- Copy your encoded code from the link to where you edit your article.
- Enclose the code by
<pre name="code" class="cpp">
</pre>
- Then publish your post as usual.
No comments:
Post a Comment