The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Konstrukt::Plugin::wiki::markup::link::article - Plugin to handle wiki article links

SYNOPSIS

See "SYNOPSIS" in Konstrukt::Plugin::wiki::markup::linkplugin.

DESCRIPTION

This one will be responsible for all wiki links (CamelCase, [[nocamelcase]]).

You should put this one at the end of the list of the link plugins since it will act like a 'catch all' plugin to match all links that haven't been matched by another plugin.

EXAMPLE

Implicit links

        CamelCaseLink
        
        !ThisLinkWontMatch

Explicit links (with description)

        [[thislinkwillmatch]]

        [[CamelCaseLink|but with another description]]
        
        [[linikwith#anchor]]

METHODS

matching_regexps()

See "matching_regexps" in Konstrukt::Plugin::wiki::markup::linkplugin for a description.

init

Initialization.

install

Installs the templates.

Parameters:

none

handle()

See "handle" in Konstrukt::Plugin::wiki::markup::linkplugin for a description.

This one is tricky.

On every request we want to check if the target wiki page exists and put out a different link if it doesn't so that the user can recognize a link to a page that doesn't exist yet.

As the decision of the existance of a wiki page must be made at the execute run we cannot determine which template to use for the link before the execute run. So the template must be processed at the execute run, which will be very time consuming.

What this plugin does, is to put both templates (for a dead and for an alive link) into the tree at the prepare run under a tag node of itself, so both templates will be processed in the prepare run und we can save this work in the execute run, where this plugin's tag node just decides which (processed) template to use.

So we're effectively moving work from the execute to the prepare run, which will lead into a bit more work in the prepare run but will save us a lot of work on every execute run. Great, isn't it?

Parameters:

  • $link - The link string.

prepare

Won't do anything in the prepare run.

Parameters:

  • $tag - Reference to the tag (and its children) that shall be handled.

execute

Here we will decide which link should be returned. Either one for dead links or one for links, that are alive.

Parameters:

  • $tag - Reference to the tag (and its children) that shall be handled.

AUTHOR

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.

This document is free software. It is distributed under the same terms as Perl itself.

SEE ALSO

Konstrukt::Plugin::wiki