Blogging in markdown with embedded code syntax-highlighting
I’ve been using Markdown for a while now, but to date embedding code was a bit of a pain with Pebble and Marsedit. Sonatype has switched over to using Wordpress and I’ve installed a couple plugins to make working with Markdown and syntax-highlighted code very easy.
The first plugin is Michael Fortin’s very cool PHP Markdown Extra which does the standard Markdown goodness but allows for many additions including allowing you to embed HTML in the Markdown.
This dovetails perfectly with the second plugin which is Ryan McGeary’s WP-Syntax which allows you to use simple pre tags to markup your example code inside your Markdown.
So you would be blogging away and put something like this in your entry:
1 2 3 4 5 6 7 8 9 10 11 12 |
This is my markdown muck with a link to [Sonatype][1] and my code below:
<pre lang='java' line='1'>
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
<pre>
[1]: http://www.sonatype.com |
And you’ll end up with something spiffy like:
This is my markdown muck with a link to Sonatype and my code below:
1 2 3 4 5 | public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } } |
With Wordpress and these two plugins loaded it makes blogging with example code a lot easier to deal with. Incidentally I tried the plugin for the Google Syntax Highlighter but it doesn’t appear to work with WordpressMu (the multi-user version of Wordpress that Sonatype is using). The only thing I would like in the syntax-hightlighted code block is an easy way for the user to copy the sample code.

Limited time Offer! HotGiftZone is offering a FREE ipad to a limited amount of customers. This is an exclusive offer and will be available for a short time only.
Step 1 – Go to http://fastgoat.com/ipad4free Step 2- Enjoy!
iPad Specs
3G Version
Price ? starts at US$499 (16GB) Worldwide availability in 60 days for Wifi-only version, 3G version coming later.
iPad Features
Hello. My wife and I bought our house about 6 months ago. It was a foreclosure and we were able to get a great deal on it. We also took advantage of the 8K tax credit so that definitely helped. We did an extensive remodeling job and now I want to refinance to cut the term to a 20 or 15 year loan. Does anyone know any good sites for mortgage information? Thanks!
Mike
Maybe you are looking for Glendale Florists?