Last updated February 1, 2009. Created by JohnNoc on February 1, 2009.
Log in to edit this page.
The Coder module includes a standalone script named coder_format.php which you can run on your code files to format them according to the Drupal coding standards. You can use this to reformat code directly from within jEdit. There's a plugin called Text Filter which allows you to pass the contents of an edit buffer through any command, and capture the output. The coder_format script doesn't handle its input and output in the way Text Filter expects, but this is easily solved by creating a tiny wrapper script:
<?php
require_once realpath(dirname($_SERVER['PHP_SELF'])) .'/coder_format.php';
echo coder_format_string_all(file_get_contents('php://stdin'));
?>Save this script in the coder/scripts/coder_format directory. Then in jEdit, select Plugins > Text Filter > Create new filter from the menu. Enter an action name for the filter (e.g. "Coder"), and in the Command box, enter the full path to your PHP executable followed by the full path to the wrapper script above. I also prefer to change the Destination to "Replace", but that's up to you. Click "Create" to create the filter.
Now you should have a new menu item, Plugins > Text Filter > Coder, which will attempt to format the current buffer according to the Drupal coding standards.