12
Mar 10

About this blog

Like half of the rest of the blogging world, I’m using Wordpress to power this blog. All Flash content is displayed using the Shadowbox JS plugin which I’d highly recommend. It’s an elegant way to avoid having too many swfs running on the same page which can be a real drain on the processor.

One of the key plugins I needed was one to format and display source code properly. I tested every syntax highlighting plugin that I could get my hands on and quickly came to two conclusions.

Firstly, I preferred the code to be displayed within <pre> tags. This seemed to be the best way to preserve the formatting of my source code. I didn’t want to spend ages prettifying source code for my blog – a simple cut & paste from my IDE was all I wanted to do. Putting the source code between <pre> tags also means I don’t have to worry about special characters getting messed up when rendered as html.

Secondly I needed a syntax highlighter that could handle Actionscript. Like Javascript, Actionscript is based on the ECMA standard so at a push I could have used a syntax highlighter that worked with Javascript. I quickly found out the most syntax highlighter plugins were using GeSHi at their core which not only supports Actionscript but just about every other programming language known to man (OK, no Piet, but when the source code for the canonical “Hello World” application looks like this, you can’t be too suprised!)

This is the source code for displaying “Hello World” in Piet. Hmmmm.

The syntax highlighter plugin I eventually settled on was WP-Syntax and with a bit of tweaking I got my source code looking almost identical to my IDE of choice, Flex Builder.

If you have the excellent monospace font “Consolas” installed, that’s what the code will be displayed in. Since discovering Consolas, I can’t believe I spent years looking at screens of code displayed in Courier New. Ugh.

Finally, I used the free “Clean Minimal” theme from Theme Lab which I tweaked a bit but what you see is 90-something percent how it looked out of the box! The only annoyance was that Theme Lab hadn’t included a call to wp_head() in header.php so the plugins weren’t being initialised. Adding the line

<?php wp_head(); ?>

between the <head></head> tags solved that problem but it took me a while to work out why the plugins weren’t working.


Leave a Reply

Copyright © 2010 The Daily Flash
Proudly powered by WordPress, Free WordPress Themes, and Linux Hosting