I'd love to use Posterous as my main geek blog, but I can't figure out how to post code to it. A geek blog without code is like Santa without a beard. Anyone know how to achieve this feat?
If it's not supported, is that a feature you'd like to see on Posterous? Since Posterous is YC-funded, I imagine they'll pick this thread up, so let them know here if this is a feature you'd want (assuming it is indeed missing).
Hm, I'll whip something up and post back here when it's ready (hopefully in the next hour).
====================
UPDATE: It's taking a little longer since I'd like to get some really slick syntax highlighting going. It's 3:25 am and I'm still recovering from a cold so I'm going to call it a night, but expect an update on the Posterous blog tomorrow: http://blog.posterous.com
====================
UPDATE 2: I couldn't sleep, so I kept working on it. 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:
[code]
your code here
[/code]
Additionally, if you want to get fancy, you can specify a language with the following syntax:
[code lang='java']
public static boolean isAwesome = true;
[/code]
This should work for both through the web interface and through the email interface.
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', 'vb.net', '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 garry@posterous.com. Thanks for all the support and ideas. Please do keep the feature ideas coming -- the best way to reach us is to email help@posterous.com, but voting up to the top of Hacker News works too. ;-)
does anybody know about a syntax highlighting web service which generates me full featured coloured html code, which can easily insert in my mail to posterous, so that is no server side stuff is needed?
Someone was mentioning on #startups that there's a google code javascript plugin to do syntax highlighting and automatically detect the language, etc...
Personally, if all it does is put the code in a dark background and monospaced font that keeps the tabbing/spacing, that's already good enough for me! Syntax highlighting would really just be extra sugar.
I like that too. markdown@posterous.com -- that kind of change is going to take a little more than an hour's worth of work, though... might have to wait til morning.
Incidentally, there's another huge vote for Markdown from this corner---for me it kind of takes posterous from the toy column to the essential column. Which is not meant as a slight to posterous; I think it's the most elegant blogging system out there, bar none. But a lack of some kind of structured text means that I'd be having to hand-code html in a mail window. And I promised myself I'm never going back there... NEVER.
Can you put in pre tags as well? Many people set white-space: pre; for code tags in CSS, but other people actually use code tags within text to distinguish they are talking about the function or programming construct error, not a specific instance of an error.