How to use Google Code Prettify on WordPress

dropboxsyntax highlightingwordpress.com

I'm writing my blog posts using Windows Live Writer and I use Syntax4writer whenever I need to include codes in the post.

The output for Syntax4Writer doesn't look good on the Bueno theme by Woothemes. And I'm just free hosting my blog on WordPress itself (not the wordpress.org one) so I can't really customize everything.

I tried using Google Code Prettify by hosting the code on my Dropbox and then including it on the script but unfortunately it doesn't work.

Is there a way on using Google Code Prettify in a free hosted WordPress blog?

If not, can you recommend another means, maybe a Live Writer plug-in, that makes syntax better looking?

Best Answer

Please read the following: http://ramblings.mcpher.com/Home/excelquirks/gaspublish.

Bruce McPherson created a way to integrate Google Prettify into Google Apps Script (GAS) allowing code to be prettified using an iFrame.

The code can be collected from many places, like Github, within GAS, ScriptDb. You're already familiar with the usage of a public Dropbox folder and that's exactly how Bruce McPherson does it as well.

I use his technique to prettify my own snippets, see example: Gplus in GAS.

UPDATE: Some feedback from Bruce McPherson:

For example, if you replace the module parameter below with some other file it should prettify it. The parameter should really be uriencoded but it can work without it.

http://xliberation.com/p/gaspubcontainer.html?source=web&module=http://xliberation.com/p/gaspubcontainer.html

To embed in a blog you can just go something like:

<Iframe src="http://xliberation.com/p/gaspubcontainer.html? source=web&module=http://xliberation.com/p/gaspubcontainer.html" style="width:800;height;400:border:none;"></Iframe>

Happy coding !!