Finally I had a chance to convert the http://alexgorbatchev.com/wiki/SyntaxHighlighter into a Wordpress plugin. So in future I can change themes freely and still continue to use syntax highlighting. Here is what was needed to be done:

  • Downloaded SyntaxHighlighter 2.0
  • Extracted files and placed in a plugin folder syntax-highlight. The folder scripts/. was extracted into /scripts folder and styles/. into /styles.
  • Implement some lines of PHP to insert the JavaScript initialization into the HTML head element.

Here is how the PHP script roughly looks:

The next step will be to package this and make it available for download!

Comments