[Pmwiki-users] Re: pmwiki-0.6.beta4 released

Patrick R. Michaud pmichaud
Mon Feb 2 16:19:01 CST 2004


On Mon, Feb 02, 2004 at 11:40:15PM +0100, Christian Ridderstr?m wrote:
> On Mon, 2 Feb 2004, Patrick R. Michaud wrote:
> 
> > PmWiki version 0.6.beta4 has just been released and is available
> >
> > * Parameterized InterMap URIs
> 
> Could you explain that a bit, or give a link?

I'll try (and give background for people unfamiliar with InterMap links)--the 
explanation will also end up in the documentation in 
PmWiki.CustomInterMap when 0.6 is released.  

In PmWiki 0.5, InterMap links allow one to specify a URI-prefix to
be prepended to the string following the "InterMap:" markup.  Thus, if
intermap.txt contains an entry such as

   Wikipedia	http://www.wikipedia.com/wiki/

then the markup "Wikipedia:Harry_S_Truman" becomes a link to
"http://www.wikipedia.com/wiki/Harry_S_Truman".  However, if one wants
the text following the InterMap markup to appear in the middle of a URI,
it can't be done in 0.5 with just InterMap entries (although there
are ways to add this to the markup).

In 0.6, an InterMap entry can now contain a '$1' which says where the 
string substitution should take place instead of at the end.  Thus, an 
intermap.txt entry like

   Jargon	http://www.catb.org/~esr/jargon/html/$1.html

will substitute the InterMap string where the $1 appears instead of
appending it at the end.  Thus "Jargon:B/bit" becomes a link to
"http://www.catb.org/~esr/jargon/html/B/bit.html".

As a longer example, I'm an Amazon.com Associate, which means I get 
money/credit from Amazon whenever someone purchases something from 
Amazon after following a link to them from my site.  To do this, I 
want to be able to simply write "Amazon:0671869205" in the markup
and have that translated into 
"http://www.amazon.com/exec/obidos/ASIN/0671869205/ref=nosim/pmichaudcom-20".
The stuff after the ASIN number is how Amazon.com knows to credit
me for any purchases made.  PmWiki's 0.5 InterMap routines couldn't handle
anything like this (and I had to create special $DoubleBrackets entries
for it)... the parameterized InterMap links in 0.6 allow me to simply put

   Amazon   http://www.amazon.com/exec/obidos/ASIN/$1/ref=nosim/pmichaudcom-20

in local/localmap.txt and I'm done.

Of course, if I was really smart I'd use this for the ISBN entry in 
the distribution's intermap.txt file and then get Amazon.com
credits for every ISBN link made all PmWiki installations...  :-) :-)
I think this probably violates Amazon.com's associates policy, though.  

Pm



More information about the pmwiki-users mailing list