views:

50

answers:

2

Hi,

I really like the editor and the pretty print functionality in stackoverflow and wonder if there exist a plugin in to use the editor and pretty print functionality in wordpress?

The simplicity and the look is at least as good as any other plugin I tried.

A: 

Looking at your comment, looks like you are looking for a Plugin which can format code. I use WP-Syntax in my blog and it supports many languages.

The default Wordpress editor is more than enough for other things ;-)

Shoban
I've already have one that I'm using, but I like the one SO uses more.
mastoj
A: 

Ok, since I want to accept an ansver and Conspicuous doesn't write his comment as an answer I'll givet it to you :). My solution to the question was to install two plugins: http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/ and http://wordpress.org/extend/plugins/markdown-for-wordpress-and-bbpress/

The google code prettify is for making the code look nice, and the markdown plugin is for enabling easy editing, but no direct preview so you have click the preview button to se any result. The result of some posts can be seen here: blog.tomasjansson.com.

Syntax help for editing can be found here: http://daringfireball.net/projects/markdown/.

You needed to tweak the markdown plugin just a little bit to get it working. Open the plugin editor and choose the markdown plugin. Find the _doCodeBlocks_callback function. Change the row the prints the pre tag to the following: $codeblock = "<pre class=\"prettyprint\">$codeblock\n</pre>";. Also, the makeCodeSpan functions return statement should be changed to: return $this->hashPart("<code class=\"prettyprint\">$code</code>");.

That made it for me anyway... enjoy.

mastoj