After changing the template:
- Copy contents of http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css and paste it into the template before ]]></b:skin>
- Add before </head>:
<script language="'javascript'" src="'http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js'/">
<script language="'javascript'" src="'http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js'/"> - Add before </body>:
<script language="'javascript'">
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
- Have instances of < replaced with <
- Be placed in a section like:
<pre name="code" class="py">
...code...
</pre>
Add extra brushes as needed...
Note that the Blogger editor eats your line indentation if you edit a posting. So where indentation is important (say, in Python, but any scripts really), paste in the script as the last part of any edit action (gah!).
No comments:
Post a Comment