Slashdot Log In
Best Weblog Application for Posting Source Code?
Posted by
Cliff
on Thu Oct 12, 2006 04:30 AM
from the if-only-html-could-indent-properly dept.
from the if-only-html-could-indent-properly dept.
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?"
This discussion has been archived.
No new comments can be posted.
Best Weblog Application for Posting Source Code?
|
Log In/Create an Account
| Top
| 75 comments
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Google... (Score:3, Informative)
(http://www.toolz4schoolz.com/ | Last Journal: Tuesday December 12 2006, @08:36PM)
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...
use slashcode (Score:2, Funny)
void main()
{
printf ("only joking!\n");
}
Re:use slashcode (Score:4, Insightful)
(http://synflood.at/blog/)
int main(void) { }
int main(int argc, char * argv[]) { }
DokuWiki (Score:5, Informative)
(http://www.preshweb.co.uk/)
An example bit of code can be done as easily as:
<code perl>
# some code here
</code>
Ikiwiki + source code coloring from Trac (Score:4, Informative)
(http://iki.fi/~ptman)
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.
This *IS* about self promotion... (Score:2)
(http://rtfm.insomnia.org/~qg/ | Last Journal: Wednesday November 16 2005, @07:11AM)
You *are* a programmer (Score:4, Funny)
(http://empyrean.kyve.net/ | Last Journal: Wednesday July 26 2006, @08:42PM)
Syntax highlighter (Score:3, Informative)
(Last Journal: Thursday May 18 2006, @07:53PM)
Not a blog, but... (Score:3, Interesting)
(Last Journal: Tuesday March 15 2005, @02:35AM)
Copy Source as HTML (Score:2, Informative)
(http://www.newtonsoft.com/blog)
You can see an example of it in a blog post here [newtonsoft.com].
Plain text, fixed font? (Score:2)
(http://kosmosik.net/)
pastecode (Score:2, Informative)
Wordpress (Score:1)
(http://smile.frensync.com/ | Last Journal: Monday November 06 2006, @08:13PM)
vim + nanoblogger (Score:3, Informative)
(http://uthcode.sarovar.org/~senthil | Last Journal: Thursday December 16 2004, @02:49PM)
You want Drupal + appropriate filter (Score:4, Informative)
(http://www.yelvington.com/)
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]
Blogger by any other name? (Score:1)
(http://pngwriter.sourceforge.net/ | Last Journal: Monday September 08 2003, @11:11PM)
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 tab). Does this suck? Yes. A lot.
Eventually I think I'll just freak out and take a screenshot of the code or something equally inane, and then I'll be able to turn the newline option back on, as having it off is quite irritating to me.
d.
WordPress + a plugin (Score:2)
(Last Journal: Wednesday July 06 2005, @10:01PM)
Serendipity + geshi plugin (Score:1)
(http://www.theripper.com/)
I've tried two (Score:2)
(http://www.alternateinterior.com/)
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)
(http://etherplex.org/)
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)
(http://localhost/ | Last Journal: Tuesday January 16 2007, @02:40PM)
This kind of solution is likely to be much cleaner and give you better results than looking for a blogging package that can handle code natively. Even if you were able to find such a package, it's unlikely it would be able to handle as many languanges as the packages that are dedicated to displaying code in an HTML format.
Test out several on opensourcecms.com (Score:1)
(http://www.vgfort.com/)
Drupal + GeSHiFilter (Score:2)
(http://baheyeldin.com/)
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)
(http://www.nand.net/~dchin)
TWiki with plugins (Score:2)
TWiki's generally great for intranet collaboration as it has good revision tracking, WYSIWYG editing (beta) and other nice features, as well as over 200 plugins including some that support action tracking, Extreme Programming support, etc.
Re: Best Weblog Application for Posting Source... (Score:1)
(http://seodiscussion.blogspot.com/)
Re:URL withheld... (Score:1)
(http://www.jesnetplus.com/ | Last Journal: Wednesday December 27 2006, @11:31PM)