This morning I have updated my blog to use a new syntax highlighter with a very appealing appearance. You can get it from http://alexgorbatchev.com/wiki/SyntaxHighlighter.

For now I just addded the code to wp-content/syntaxhighlighter and inserted the following HTML code to my theme header template

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!-- Google syntax highlighter -->
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushBash.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushDelphi.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushDiff.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushGroovy.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushJava.js"></script>

<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushPython.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushRuby.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushScala.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushVb.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/shBrushXml.js"></script>

<link type="text/css" rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/styles/shCore.css"/>
<link type="text/css" rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/styles/shThemeDefault.css"/>

<script type="text/javascript">
  SyntaxHighlighter.config.clipboardSwf = '<?php bloginfo('stylesheet_directory'); ?>/../../syntaxhighlighter/scripts/clipboard.swf';
  SyntaxHighlighter.all();
</script>
<!-- -->

Next I will try to convert this setup into a wordpress plugin so it will survive changes of theme etc.

Comments