[pmwiki-devel] Sharing common functions between recipes / a core modification request

Dominique Faure dominique.faure at gmail.com
Sat Nov 4 14:16:45 CST 2006


On 11/4/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Sat, Nov 04, 2006 at 05:22:39PM +0100, Dominique Faure wrote:
> > On 11/4/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > >On Sat, Nov 04, 2006 at 02:22:16PM +0100, Dominique Faure wrote:
> > >> On 11/4/06, Hans <design5 at softflow.co.uk> wrote:
> > >> >Thursday, November 2, 2006, 11:06:34 AM, Dominique wrote:
> > >> >
> > >> >> Thus, my request core modification is to provide an
> > >> >> ExplodeLink()-equivalent function in (and BTW having ResolveLink()
> > >> >> using it).
> > >> >
> > >> >> The ResolveLink() could be efficiently shared between all the recipes
> > >> >> that would make use of attachement/url specifications and therefore
> > >> >> being integrated also...
> > >> >
> > >> >Dom, I am all for reusing functions and code.
> > >> >Especially since I have difficulty in understanding them anyway!
> > >> >I can't comment on the implications of your request for changing the
> > >> >ExplodeLink function in pmwiki (if I understood you correctly).
> > >> >But I hope Pm was listening.
> > >> >
> > >>
> > >> In fact, the core only has the "all-in-one" MakeLink() function
> > >available.
> > >> My purpose here was to have it splitted in two, with something
> > >> equivalent to my ExplodeLink() made available in the core. (the
> > >> current implementation is a quasi pure copy-paste).
> > >
> > >I looked at the code, but I couldn't quite figure out what
> > >features ExplodeLink() has that MakeLink() doesn't already
> > >provide...?
> > >
> >
> > Short answer: absolutely nothing
> >
> > Long answer: ExplodeLink() is in fact reduced to the MakeLink() code
> > part which splits a wiki url spec into imap+path. I just found really
> > convenient to have it available for recipes which would deal with
> > attachement stuff.
>
> I'm sorry, I'm being dense (and on a tight schedule today, without
> a lot of time to look at things in detail).
>
> What information can you easily get out of ExplodeLink() that is
> hard to get from MakeLink()?
>
> > The MakeLink() makes the same job but goes too far when providing the
> > resulting target url, ie. from the recipe point of view, with
> > MakeLink() I can't easily determine if the target url is resulting
> > from an attachment or somewhere else.
>
> In other words, you want to be able to get the IMap type?  Is that
> the big difference, or ...?
>

The main idea is to be able to detect weither the linked resource is
stored via an attachement or not. Then, knowing this, I'm able to:
* conditionally prevent the use of external resources via the recipe markup,
* keep using local resources as local files: we're not always needing
a network transport protocol to handle them.
* but above all, if the attachement doesn't exist, gracefully render
as the usual upload link.

Dom



More information about the pmwiki-devel mailing list