views:

1202

answers:

8

I'd like to start a 'cookbook' style blog where I post my coding solutions to common problems, mainly for my own use - what's the best blog service or engine to use in terms of posting code snippets (formatting, syntax highlighting etc)?

If I have to write my own I will, but I'd rather just go with a pre-built solution if I can.

+1  A: 

I don't think the blog service/blog engine matters at all. The difference will be which JavaScript code highlighter you use. As long as you can alter the template/design of your blog to add the appropriate JavaScript, you'll have the same choice of highlighters whichever one you use.

Philip Morton
+4  A: 

I'm quite happy with SyntaxHighlighterPlus for WordPress. It is easy to use and produces good looking snippets. However, it renders the code on the client, so there's a small performance overhead and thus it should not be used to entire application listings, but for snippets its excellent.

My blog is at kodehoved.dk if you want to see samples.

Brian Rasmussen
+2  A: 

Thanks guys, I wasn't aware that this kind of thing was usually done client-side, but after looking around a bit I've decided to use Prettify.

Here a couple of other related questions which I found in the sidebar, for future reference:

Syntax highlighting code with Javascript

What are the best software and templates for a programming blog?

Cheers!

Mark B
+1  A: 

Check out BlogTrog. It's designed for just what you want. I use it all the time.

JimDaniel
A: 

http://www.neathighlighter.com is a very nice online code highlighter which highlights in standard colors and has the ability to highlight source code which is mixture of different languages

A: 

I have setup markdown which support pygments. I do processing on client side before publishing to blog.

I put the code I want to highlight in a file (actually the whole blog post is formatted with plain text markdown) and run it through markdown (pygments extension on). Pygments is used to do syntax highlighting of the code snippets.

All that is needed for the source code to be detected is to specify language and have it indented by at least 4 spaces.

I then just paste the formatted blog entry in html format into blog. I'm using blogger, I've updated blogger CSS to show syntax in colors but it can be done by including a link to css.

See here how to setup markdow and pygments to do syntax highlight for blogger.

stefanB
A: 

Hi,

I made jQuery.Syntax : http://www.oriontransfer.co.nz/software/jquery-syntax

I also made a plugin for WordPress : http://wordpress.org/extend/plugins/jquery-syntax/

I'm probably biased but I'd say its pretty good and easy to use. There is also a plugin for DokuWiki, which you could potentially use as a blogging tool.

Mr Samuel