Moving Forward

Homepage of Andrew Robinson

Syntax Highlighting in Posterous

with 2 comments

As part of my new commitment to blogging and sharing my knowledge with the outside world one of my first goals is to tune the tools needed to create professional, easy-to-read blog articles. Like many bloggers I do not want to have to worry about the format or the administration behind the blog, I want to create content.

To that end I have successfully figured out how to highlight syntax on Posterous:

  1. Take your code and import it into your favorite text editor ( Editpad Pro is my favorite)
  2. Replace all line breaks with <br />. To do this in Editpad simply use their powerful Find and Replace dialog box to select all line breaks and replace them with a HTML equivalent.
  3. Surround your code in [ code] tags. You can specify a list of supported languages to achieve the formatting you desire. In SyntaxHighligher, the JavaScript-based engine powering Posterous’s highlighting these language formats are called Brushes. A good list is available here: http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes
  4. Paste this muddy collection of code, HTML, and text into the Posterous post editor, in plain-text mode. 
  5. You’re done!

This process will produce professional-looking syntax highlighting and create greater visibility for your readers. 

Written by Andrew Robinson

May 26th, 2010 at 7:26 pm

Posted in Uncategorized

2 Responses to 'Syntax Highlighting in Posterous'

Subscribe to comments with RSS or TrackBack to 'Syntax Highlighting in Posterous'.

  1. Yah, Posterous code highlighting kind of sucks, especially when the code is HTML. I think I’m going to stick with embedding gists.

    Tommy

    28 Aug 10 at 1:12 am

  2. Frustrating, much. Thank you oh all-powerful github!

    Peter Ehrlich

    20 Mar 11 at 7:29 pm

Leave a Reply