[cgi-wiki-dev] Creating URLs

Tom Insam cgi-wiki-dev@earth.li
Tue, 26 Oct 2004 08:31:31 +0100

On Oct 26, 2004, at 5:44, Kake L Pugh wrote:

> On Fri 22 Oct 2004, Tom Insam <tom@jerakeen.org> wrote:
>> The formatter modules all need a way of turning a node name into an 
>> url
>> for embedding in <a> tags. The wiki code itself will need to turn node
>> names into urls for linking from various other places. I'd like my 
>> Node
>> object to know what their own urls are. And preferably I'd like the
>> code that turns a name into an url to live in the same source file as
>> the code that takes a passed CGI request parameter and turns it into a
>> node name. Thus it seems to make sense to put this code into
>> CGI/Wiki.pm itself.
> CGI/Wiki.pm doesn't do any actual CGI and I don't want it to start
> having to care about how the information it spits out is output.
> I think what you want is an extension of the node_name_to_node_param
> and node_param_to_node_name methods in CGI::Wiki::Formatter::UseMod
> - see also the make_internal_link (etc) methods in there.

This would be a solution, if we could nail down that api and say 'all 
formatter modules will provide these methods'. However, I don't like it 
- if I change formatters to one that doesn't support my linking style, 
I don't want to have all my links change. What the links look like is a 
completely seperate problem from how we turn wiki text into HTML.