Developer Formatter is a WordPress plugin that help you create a better display of your codes.
For everybody that publish examples, source-code and some tips about a specific language.
This plugin do use of GeSHi server-side highlight system, so you will have support for more then 90 languages, including PHP, Html, JavaScript, CSS, Java, Python, Delphi, C++, C, Visual Basic and much more.
This plugin do use of jQuery a powerfull JavaScript library.
Download it here: http://wordpress.org/extend/plugins/devformatter/
The advanced format system provide you a extreme engine that recognize some pieces of the code and decode it with the right language, for example:
| HTML | | copy code | | ? |
| 01 | <html> |
| 02 | <head> |
| 03 | <title>Html Test</title> |
| 04 | <script> |
| 05 | <!-- |
| 06 | /* My Javascript code */ |
| 07 | function MyJSFunction(AParam){ |
| 08 | alert('Param: ' + AParam); |
| 09 | } |
| 10 | var Variable = new Array(15.0, 30.0, 45, "test", MyJSFunction); |
| 11 | //--> |
| 12 | </script> |
| 13 | |
| 14 | <style type="text/css"> |
| 15 | /* My CSS structure */ |
| 16 | body { |
| 17 | background: transparent url("bg.gif") no-repeat 0% 0%; |
| 18 | font-family: verdana; |
| 19 | font-size: 16px; |
| 20 | } |
| 21 | table, table tr, table tr td { |
| 22 | padding: 0; |
| 23 | margin: 0 !important; |
| 24 | } |
| 25 | div#bullet { |
| 26 | font-weight: bold; |
| 27 | } |
| 28 | .hints { |
| 29 | font-style: italic; |
| 30 | } |
| 31 | </style> |
| 32 | </head> |
| 33 | <body onload="alert('Hello World')"> |
| 34 | <table> |
| 35 | <tbody> |
| 36 | <tr><td valign="middle" align="center"> |
| 37 | <strong>Table test 1</strong> |
| 38 | </td></tr> |
| 39 | |
| 40 | <tr><td valign="middle"> |
| 41 | <li>Table test 2</li> |
| 42 | </td></tr> |
| 43 | |
| 44 | <tr><td valign="bottom"> |
| 45 | <span>Table test 3</span> |
| 46 | </td></tr> |
| 47 | </tbody> |
| 48 | </table> |
| 49 | </body> |
| 50 | </html> |
Look that the HTML code have 3 block of languages code: HTML, JavaScript and CSS. The Developer Formatter will understand the diference and provide you a better display for you code.
Other example about the capacities of DevFormatter:
| PHP | | copy code | | ? |
| 01 | <?php get_header(); ?> |
| 02 | |
| 03 | <div id="content" class="narrowcolumn"> |
| 04 | |
| 05 | <?php if (have_posts()) : ?> |
| 06 | |
| 07 | <?php while (have_posts()) : the_post(); ?> |
| 08 | |
| 09 | <div class="post" id="post-<?php the_ID(); ?>"> |
| 10 | <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> |
| 11 | <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> |
| 12 | |
| 13 | <div class="entry"> |
| 14 | <?php the_content('Read the rest of this entry »'); ?> |
| 15 | </div> |
| 16 | |
| 17 | <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> |
| 18 | </div> |
| 19 | |
| 20 | <?php endwhile; ?> |
| 21 | |
| 22 | <div class="navigation"> |
| 23 | <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> |
| 24 | <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> |
| 25 | </div> |
| 26 | |
| 27 | <?php else : ?> |
| 28 | |
| 29 | <h2 class="center">Not Found</h2> |
| 30 | <p class="center">Sorry, but you are looking for something that isn't here.</p> |
| 31 | <?php include (TEMPLATEPATH . "/searchform.php"); ?> |
| 32 | |
| 33 | <?php endif; ?> |
| 34 | |
| 35 | </div> |
| 36 | |
| 37 | <?php get_sidebar(); ?> |
| 38 | |
| 39 | <?php get_footer(); ?> |
| 40 |
Very easy to Install:
Post here issues or feedbacks.
Thanks

Hi!
DevFormatter seems to be what I need, thanks for your work on this.
I have noticed that in your last example the grey background (behind the devcodetools) does not grow to the right as far as the scrollable window goes. How would I go about setting it to the same width?
Cheers
Hi again!
Whatever you did from version 2008.0.1.3 to 2008.0.1.4 — it works very well.
Thanks for reacting to my request so quickly!
Cheers
Hi! You should have a contact page or anything easy for contact with you.
I sent the next to geshi-devel@lists.sourceforge.net but it was not accepted:
* There is a bug in: **
because the language attribute is deprecated.
It should be used: **
* When it’s activated, my blog shows the next error:
Fatal error: Function name must be a string in /path/to/my/wordpress/wp-content/plugins/devformatter/devformatter.php on line 850
Greetings!
I have noticed in Word Press 2.6.2 when I add PHP source code to an post, and save it as a draft then try to edit it later, the text editor in word press removes some of my code. Is there anyway to stop this ?
Hi! I think this is a great plugin. It’s actually the only one that doesn’t interfere with the wysiwyg editor in Wordpress 2.6.2. Unfortunately I have a problem with the position the code is pasted in the editor, it is always on the top of the page and not on the cursors position. Is this a known problem?
There is a bug when code contains more than 99 lines (line count is 010, 020, 030, 040, 050, 060, 070, 080, 090, 010, 110, 120, …)
It’s me again…
I’ve parsed your code and I think the problem is in String.prototype.pad (devfmt_common.js file)
I’m not very fluent in javascript but I think changing this method as follow could fix the bug.
/*String.prototype.pad = function(l, s, t){return s || (s = " "), (l -= this.length) > 0 ? (s = new Array(Math.ceil(l / s.length)+ 1).join(s)).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2))+ this + s.substr(0, l - t) : this;}*/}}I hope it will help
Hi there, thanks for this mod, really needed.
After installation i have this error when i go to the settings>Devformatter
:
Warning: Invalid argument supplied for foreach() in /fullpath/wp-content/plugins/devformatter/devinterface.php on line 79
How to fix it?
I’m using WordPress version 2.6.3
Thanks in advance
I’m using devformatter 2009.0.1.14. Thanks for the useful plugin.
Some thoughts:
1. I ran into this when moving wp-content outside the siteurl. Since 2.6, WP_PLUGINS_URL is a better method for determining plugin directory rather than get_option(’siteurl’) in devformatter.php at line 17.
2. Some themes, iNove in particular, like to add a background-image to pre tags. It would be a good idea to set the main containers to have no background-image for the default values. Though thanks for making this setting easily editable.
3. While I eventually found the configuration panel in the admin interface, it would be useful to document which heading is used to find the settings. (I might just be a newbie though.)
4. While having all of the documentation for geshi is useful, it might be useful to trim some of the developer oriented documentation.
Thanks again for the plugin.
Thanks for a wonderful Plug-in (-:
but in FAQ you must add about changing permissions for geshi folder (-:
-ViruSoul