Monday, November 9, 2009

How to publish code samples to Posterous?

I've just popped an early version of it live for you to try out. All you have to do is surround your code block with the following tags:

your code here

Additionally, if you want to get fancy, you can specify a language with the following syntax:

 [code lang='java']
public static boolean isAwesome = true;

The available list of languages is: 'cpp', 'c', 'c++', 'c#', 'c-sharp', 'csharp', 'css', 'delphi', 'pascal', 'java', 'js', 'jscript', 'javascript', 'php', 'py', 'python', 'ruby', 'rails', 'ror', 'sql', 'vb', '', 'xml', 'xhtml', 'xslt', 'html', 'xhtml'

Current known issues: HTML formatting might be a little spotty at the moment. Will be fixing asap. I also see some intermittent errors where the code isn't getting properly recognized.

Please report any bugs to me at Thanks for all the support and ideas. Please do keep the feature ideas coming -- the best way to reach us is to email, but voting up to the top of Hacker News works too. ;-)


It took a Google search to find out, but man that is slick. Let's see if CFML works:

<cfset pleaseWork = "I work!" />

No comments:

Post a Comment