* Chris Winters <[EMAIL PROTECTED]> [2002-04-18 10:56]:
> On Thu, 2002-04-18 at 10:47, darren chamberlain wrote:
> > * Randal L. Schwartz <[EMAIL PROTECTED]> [2002-04-18 10:20]:
> > > Maybe we need a "patterns in TT" wiki or something.  Heck, we need
> > > a wiki in TT as well. :)
> > 
> > I started writing something like this, as a filter.  The entirety of
> > it was, basically:
> > 
> >   sub wiki_factory { my $base = shift; ...
> 
> I've been itching to do a project to try out Text::WikiFormat and
> integrate it into OpenInteract, which may or may not be done through
> TT.  (Unfortuntely, umpteen other projects are itching more
> fiercely...)

OK, I looked at Text::WikiFormat; it looks pretty cool.  Here's the
wiki_factory. rewritten to use Text::WikiFormat:

  use Text::WikiFormat;

  sub wiki_factory {
      my $tags = shift || undef;
      my $options = shift || undef;

      return sub {
          my $text = shift;
          return Text::WikiFormat::format($text, $tags, $options);
      };
  }
  
tags and options (the optional second and third arguments) are passed
into the factory function and propagated to the returned sub ref.

(darren)

-- 
The man who is denied the opportunity of making decisions of
importance begins to regard as important the decisions he is
allowed to make.
    -- C. Northcote Parkinson


Reply via email to