Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49199

Beautifier

$
0
0

Just a heads up that I've been working on something of interest to this group. I am making a 'code beautifier' module privately for use by my company - we have some peculiar standards like '3 spaces' for a tab - and I know I will be inconsistent due to me switching between Drupal and other standards.

The idea is that it is a web form that you fill in and it gives you the code you need, all formatted and indented nicely.

I'm also putting it up on drupal.org where it may hopefully take on a life of it's own. I've included a default implementation of the drupal 6 coding standards - a large part of which is based on algorithms I found in the coder_format scripts by Sun that came with the Coder module. I never quite figured out how to use coder_format - but I did like the ideas inside there, so I've turned it into a Drupal module. I've split up the functions into more discrete units that can be removed/chopped/changed rather easily.

It is a bit less efficient than Sun's original script, but it is designed to be expandable/flexible via hook implementations and presets, and eventually via front-end forms. I plan to demonstrate this by extending it to support Zend and PEAR standards, as well as reformatting other source code types, such as CSS and XML.

Working Example: http://braksator.com/drupal6/beautifier
Development: http://drupal.org/project/beautifier

I understand if Sun will hunt me for hacking apart his state-of-the-art program without bothering to figure out how to use it in the first place (I am a sook when it comes to 'command lines'), but I have only tried to do a quick Drupal 6 standards implementation with as little work as possible - so reusing the tried and tested algorithms was the logical solution, since the official reason I am making this module is not for Drupal PHP.

Still early days for this project, but it is working on all the code I've tried.


Viewing all articles
Browse latest Browse all 49199

Trending Articles