Best Weblog Application for Posting Source Code? 75
BrewerDude asks: "I've set up a blog about programming (URL withheld: this isn't about self-promotion). I'm currently using one of the popular blog hosting services, but find it lacking when it comes to handling source code snippets in posts. It's even worse when it comes to dealing with code snippets that people include in their comments. At this point I'm frustrated enough that I'm ready to move from that service to something else. Ideally, I'm looking for something that will handle syntax highlighting for a variety of languages and do this for both the posts and the comments. I'd prefer a hosted solution, but am not opposed to installing and maintaining my own instance of a blog application if necessary. What have you found to be the best blog application when it comes to supporting posts and comments that include source code?"
Google... (Score:3, Informative)
Top result: http://www.google.com/search?q=coding+blog [google.com] is powered by something I'd never heard of called Community Server http://communityserver.org/ [communityserver.org].
I'm currently using one of the popular blog hosting services, but find it lacking when it comes to handling source code snippets in posts.
I can see what you mean after swiftly browsing some of the other sites that came near the top of the above search... I would have thought WordPress would have a plugin though...
Re: (Score:2)
Unfortunately, the readers of the site are generally of the opinion that "The real WTF is this forum software" [alltheweb.com] because "the forum software sucks"
For what it's worth, it appears to be great as a blogging tool; Alex seems to like the way it works for the blogging functions, but the forum functions are what are generally found to be "quirky"...
Re: (Score:2)
Re: (Score:3, Informative)
Scott Reilly's Preserve Code Formatting plugin [coffee2code.com] is working fine for me with WordPress 2.0.4.
use slashcode (Score:2, Funny)
void main()
{
printf ("only joking!\n");
}
Re: (Score:1)
Its got all the elements of a freidnster type social networking site (with friends and foes and private discussions etc).
Its like web 2.0 without the chunky graphics.
Re: (Score:2)
Not that I doubt your analytical abilities (whoever you may be), but what makes updating a frame (or div, or whatever else you might need to update) with javascript a terrible idea? What's the better alternative?
If you're specifically talking about frames, I'd tend to say that frames are a bad idea in and of themselves, but I'm wondering what you mean specifically.
Re: (Score:1)
Re:use slashcode (Score:4, Insightful)
int main(void) { }
int main(int argc, char * argv[]) { }
Re: (Score:1)
My compiler was happy, my programs worked and I only ever used the int return when I needed to.
Re: (Score:2)
Men have been shot for less than that. (Seriously, never admit that in comp.lang.c )
Re: (Score:1)
Re: (Score:2)
"or some other implementation-defined manner" (ISO/IEC 9899:1999 (E), s. 5.1.2.2.1 "Program startup")
Maybe the guy is writing code for some weird embedded OS? ;)
DokuWiki (Score:5, Informative)
An example bit of code can be done as easily as:
<code perl>
# some code here
</code>
Re: (Score:3)
Ikiwiki + source code coloring from Trac (Score:4, Informative)
Re: (Score:1)
JavaScript syntax highlighting (Score:4, Informative)
http://dean.edwards.name/my/examples/star-light/ [edwards.name]
What you need to use it is a blog that will let you post files to the server or create your own custom HTML templates, and then let people post HTML code. Code wrapped in <pre class="javascript"> gets highlighted correctly.
If you can't post files, a bit of hacking around with the source code and you can embed it in a template and invoke it manually with javascript.
Wordpress lets you post your own HTML templates with script - either install it on your own server or go for their free hosted service at wordpress.com.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
This *IS* about self promotion... (Score:2)
You *are* a programmer (Score:4, Funny)
Re: (Score:2)
Re: (Score:2, Informative)
Re: (Score:2)
http://backpan.perl.org/authors/id/C/CH/CHTTRAX/ [perl.org] provides listing, which converts C++ or Perl to LaTeX. If you want a solution for other languages, well, no ideas.
Re: (Score:3, Informative)
Oh, absolutely. As a programmer, I say it is his SACRED DUTY to uphold the tradition of Not Invented Here!
Re: (Score:2)
Re: (Score:1)
Re: (Score:1)
And now for a properly formatted post... damn Preview Button!
>>one of the key aspects of an effective programmer is laziness
I couldn't agree more... and that's probably why I have so many ideas, yet so few implemented products to show for it. ;)
But I digress... Phil Haack makes some great points about rolling your own blog engine [haacked.com] and why such attempts often come up short.
The whole idea of having proper source code formatting/highlighting built into the blog engine is something that I too hav
Syntax highlighter (Score:3, Informative)
Re: (Score:2)
Geshi indeed. (Score:2)
Re: (Score:1)
Not a blog, but... (Score:3, Interesting)
Copy Source as HTML (Score:2, Informative)
You can see an example of it in a blog post here [newtonsoft.com].
Re: (Score:2)
Re: (Score:1, Flamebait)
How do you achieve that? is it the command
Re: (Score:2)
But I would not call it clean HTML code as it uses FONT tags.
Re: (Score:3, Informative)
let use_xhtml=1
let html_use_css=1
Plain text, fixed font? (Score:2)
pastecode (Score:2, Informative)
Re: (Score:1)
Interesting. That could be a useful site. Here is an example I tried. Linux kernel syscalls in user space. :) [pastecode.com]
Wordpress (Score:1)
Re: (Score:1)
Bennett McElwee, has a Wordpress plugin that gives you more control over the appearance of your code in your posts. You can get it here [thunderguy.com]. There is also an "alternatives" section near the bottom of the page listing four more plugins that do similar work in different ways depending on your needs. (How cool is that?)
Wordpress does have a very basic code formatting button for posts, but not for comments. As usual, there is already a plugin [dancameron.org] that solves that
vim + nanoblogger (Score:3, Informative)
You want Drupal + appropriate filter (Score:4, Informative)
http://drupal.org/ [drupal.org]
http://drupal.org/project/codefilter [drupal.org]
GeSHIFilter: http://drupal.org/node/65961 [drupal.org] and demo: http://www.ubisum.com/node/27 [ubisum.com]
I second that (Score:2)
PHP can be entered with <?php to start, other languages can be wrapped in <code> with codefilter. I haven't tried GeSHIFilter, but parent is right that it seems to add highlighting to the rest of the languages.
Blogger by any other name? (Score:1)
How did I get around this limitation? I turned off "Turn new lines into <br>" in the prefs, and edited the post in HTML mode (I didn't ever click on the Composer or Preview
WordPress + a plugin (Score:2)
Re: (Score:2)
Serendipity + geshi plugin (Score:1)
I've tried two (Score:2)
Use separate syntax highlighting programs. (Score:2)
Wordpress + VIM Syntax Plugin (Score:2)
Wordpress has a plugin that uses some vim magic to syntax highlight code.
It may be computationally expensive (I dunno), but there's always the wordpress caching plugin as well. ;)
Emacs Muse (Score:3, Informative)
If you want to see the source file in emacs that generated that, check out the muse source [etherplex.org] for my site. Keep in mind that when using it in Emacs, the markup doesn't actually appear - it is converted to the proper fonts on-the-fly in Emacs.
In this context, the use of htmlize [fej0wr.hr] is perfect for generating an HTML form of your code buffer from emacs. Whatever your color scheme, htmlize will pick up the colors and use them to generate the HTML. If you're not publishing an entire page, I suggest you set htmlize to use the "font" method for generating html that can be used without corresponding matching CSS. If you use Emacs color-theme [emacswiki.org] package, the theme "BlippBlopp" produces good results for publishing on the web.
The only thing this system lack that I care about is comments, but since no one reads my blog, its not that big of an issue. I installed SimpleMachine's SMF [simplemachines.org] for blog comments and other forum needs. Vanilla [getvanilla.com] may also be a good choice.
Finally, it's worth mentioning that I can then edit my site from anywhere via Tramp mode [emacswiki.org] in Emacs, which allows seamless file editting on remote servers over SSH. This way, I can edit my site from my laptop on the road, or my deskktop at home without worrying about having the code with me. Muse will then publish remotely as well (though there seems to be a bug with RSS generation and Tramp that I need to work out).
Why should this be part of the blogging software? (Score:2)
This kind of solution is likely to be much cleaner and give you better results than looking
Test out several on opensourcecms.com (Score:1)
Drupal + GeSHiFilter (Score:2)
You can also get a pre-hosted account at Bryght [bryght.com], but it is not free like other blogging services.
Disclaimer: I am a contributor to the Drupal project.
finger and .plan? (Score:2)
TWiki with plugins (Score:2)
TWiki's generally great for intranet collaboration as it has good revision tracking, WYSIWYG editing (
Re: Best Weblog Application for Posting Source... (Score:1)