Hi,
On Sat, Jan 15, 2005 at 05:54:20PM -0600, Marcelo E. Magallon wrote:
> The WaflPhrase is easy. Parsing the headings requires subclassing
> Kwiki::Formatter::Heading.
I forgot to ask the important bit: does this really mean that one has
to subclass Kwiki::Formatter?
As far as I can see, it would go along the lines of:
package My::Formatter;
use Kwiki::Formatter -Base;
const class_id => 'my_formatter';
const class_title => 'My Formatter';
const class_prefix => 'My::Formatter::';
sub formatter_classes
{
map
{
my $super_class_prefix = $self->SUPER::class_prefix;
/::|\bHeading$/ ? $_ : "$super_class_prefix$_";
}
super;
}
package My::Formatter::Heading;
use base 'Kwiki::Formatter::Heading';
const formatter_id => 'my_heading';
sub html_start { ... }
sub html_end { ... }
sub match {
...
}
I find the hackery with formatter classes rather ugly.
Thanks,
Marcelo