Hi! On Wed, Oct 27, 2004 at 10:17:07AM -0400, Ian Langworth wrote:
> Interesting -- please paste how you're using the formatter. The problem is/was that KwikiLinks need a working kwiki to resolve the KwikiLink to wichever pages it referes to. See this line in Kwiki::Formatter (line 322): my $class=$self->hub->pages->new_from_name($target)->exists > I still haven't sat down to figure out how to subclass it. > (Ingy?) However, I have managed to hijack it and massage its > output for certain bits, if this helps: > > http://xrl.us/do3m I used this to develop a subclass of Kwiki::Formatter. You can find it here: http://svn.zsi.at:1000/repos/Template-Plugin-KwikiFormat/releases/Template-Plugin-KwikiFormat-1.01/lib/Template/Plugin/KwikiFormat/FakeKwiki.pm I got this working from the command line (i.e. ./Build test), but it blew up horrible when I loaded it into mod_perl, presumably because something (I assume Spoon::Formatter) uses CGI, which did some strange things in mod_perl context and died. I tried various thing from reasonable to absurd, but nothing worked. So I ditched the subclassing attempt and just changed some methods/classes by brute-forcely overriding them (Kwiki::Formatter::ForcedLink::html, Kwiki::Formatter::WikiLink::html, Kwiki::Formatter::TitledWikiLink::html) The result is available from CPAN (or should be soon) as http://search.cpan.org/~domm/Template-Plugin-KwikiFormat-1.02/ It works, which is good, but the only downside is that I cannot alter some behaviour. For example I wanted to change Kwiki::Formatter::TitledHyperLink to allow relative links like so: [/relative/link.html see here] But I couldn't change const pattern_start => qr{long_regex} (line 343) (just as a small side note, in addition to some stuff mentioned on #kwiki: If this was implemented as 'normal' class data instead of Spiffy magic, it would be fairly easy to change the value. If it is possible, please tell me how!) To sum up: I think Kwiki is a nice tool and uses some nice and 'spiffy' ideas. But those nice and spiffy things make re-useing parts of Kwiki really hard. One might argue that it is complete nonsense to use a wiki toolkit for something other than a wiki, but this is Perl :-) Anyway, thanks to all of you for Kwiki and whatever is used to make it tick.. (Oh, I probably won't reply in the next days, as I'm going to Munich from tomorrow until Sunday evening (without computer). So don't take prolongeg silence from me as an insult - I will reply (if there's something to reply to...)) -- #!/usr/bin/perl http://domm.zsi.at for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
