I use Apple's Keynote for doing my presentations and naturally these include some bits of code that need highlighting so that it’s easier to read.
There are a few ways I could do this, the first would be to make a screenshot of the highlighted text and then insert it into the slide, this seemed like an awful lot of work to achieve something that should be so simple.
The solution was fairly obvious when I went looking, Keynote includes an object known as Webview that inserts the output of a URL into the slide, this in turn is rendered using Webkit (Safari) in the background and saved. The first time around I used a simple script with highlight_file but this was a pain when wrapping occurred.
In the end I used GESHI which is a highlight library written in PHP that supports the syntax highlighting of around 50 different programming and scripting languages. Specifically I use PHP and the SQL types, though I had to tweak it a little to add some SQLite keywords.
Installation is relatively simple, download GESHI and extract to a folder on your local web server, download my keynote.php script and put it in the same folder as GESHI and finally put some code somewhere for the file to highlight. In my case I have a folder for each talk.
The URL to do the highlighting is keynote.php?file=folder/file.php
You can see a quick example of how this looks highlighting some PHP Code is keynote looks.
There are a few other parameters that you can use to manipulate the output. They are size, language, nolines and ln. These control the text size, the language being highlighted, if lines should be shown and the line number to start at respectively
I recommend that you don't make this publically accessible in case someone attempts to view a file they shouldn't.