See the synopsis for a really simple formatter example. MojoMojo uses Module::Pluggable::Ordered to process all the formatter plugins. Just specify when you want to trigger your formatter by providing a format_content_order method which returns a number to specify when you want to run. The plugin order for the default plugins is currently as follows:

If you want your formatter to do something, you also need to override format_content. It gets passed its classname, a scalar ref to the content, and the context object. It should return the scalar ref.