[Pmwiki-users] http references with : in the link

John Rankin john.rankin at affinity.co.nz
Wed Apr 9 23:07:24 CDT 2003


Just a box of birds :) I'll give it a go & report back.
--=20
JR

On Thursday, 10 April 2003 11:50 AM, Patrick R. Michaud <pmichaud at sci.=
tamucc.edu> wrote:
Argggh, another bug.  Change UrlPagePattern to be UrlPathPattern, as in

     $EnableThisWiki =3D 0;		# to avoid including thiswiki.php=20
     $LinkPatterns["\\bThisWiki:($UrlPathPattern)"] =3D=20
       "<a href=3D'$ScriptUrl/\$1'>\$0</a>";
     $LinkPatterns["\\bThisPage:($UrlPathPattern)"] =3D
       FmtPageName("<a href=3D'\$PageUrl/\$1'>\$0</a>",$pagename);
     $LinkPatterns["\\bThisGroup:($UrlPathPattern)"] =3D
       FmtPageName("<a href=3D'\$ScriptUrl/\$Group/\$1'>\$0</a>",$pagename)=
;

I'm writing all of this from a location where it's not easy for me to=20
test and verify this code--sorry for any confusion.

Pm


On Wed, 9 Apr 2003, Patrick R. Michaud wrote:

> Followup to my previous message...
>=20
> I found a slight potential bug in my ThisWiki code--it should be
>=20
>     $EnableThisWiki =3D 0;		# to avoid including thiswiki.php=20
>     $LinkPatterns["\\bThisWiki:($UrlPagePattern)"] =3D=20
>       "<a href=3D'$ScriptUrl/\$1'>\$0</a>";
>     $LinkPatterns["\\bThisPage:($UrlPagePattern)"] =3D
>       FmtPageName("<a href=3D'\$PageUrl/\$1'>\$0</a>",$pagename);
>     $LinkPatterns["\\bThisGroup:($UrlPagePattern)"] =3D
>       FmtPageName("<a href=3D'\$ScriptUrl/\$Group/\$1'>\$0</a>",$=
pagename);
>=20
> This is the same as before but adding word breaks ("\\b") at the
> beginning of the patterns.
>=20
> Also, the backslashes in front of $1 and $0 might be optional--use
> whichever one works.
>=20
> Pm
>=20
>=20
>=20
>=20
> On Wed, 9 Apr 2003, Patrick R. Michaud wrote:
>=20
> > On 10 Apr 2003, John Rankin wrote:
> >=20
> > > Let me summarise the requirements I have been asked to meet and the=20
> > > approach I have been taking.
> > >=20
> > > 1. Distinguish links that are local to the encyclopedia from those=20
> > > that will take a visitor elsewhere, preferably by using a different=20
> > > link colour. This should happen automatically -- the author focuses=20
> > > on content, the style sheet takes care of presentation.
> > > [...]
> >=20
> > Okay.  I can think of several ways to do what you're wanting to do, so
> > let me propose one way and we'll see where it leads.  It may require =
several
> > iterations to get there so let's just take it one step at a time.
> >=20
> > First, I've made a couple of minor modifications to PmWiki and =
released
> > it as 0.4.9.  This new version introduces two new variables:  $=
UrlLinkFmt and
> > $UrlImgFmt which determine how URLs should be formatted by the =
FmtUrlLink
> > function (roughly analogous to $WikiPageExistsFmt for the FmtWikiLink
> > function). =20
> >=20
> > So, if you want to have external links appear with a special style =
sheet,
> > you can just set $UrlLinkFmt to be=20
> >    "<a href=3D'\$Url' class=3D'url'>\$LinkText</a>"
> > and all URL references will come out with a class attribute set.
> >=20
> > As to the problem with ThisPage, ThisGroup, and ThisWiki, they're =
currently
> > implemented as InterMap links but they're also local customizations.  =
And they
> > don't have to be implemented via InterMap--there are other ways to do =
that.
> > So, to have these links not be treated as external links, simply do:
> >=20
> >    $EnableThisWiki =3D 0;		# to avoid including thiswiki.php=20
> >    $LinkPatterns["ThisWiki:($UrlPagePattern)"] =3D=20
> >      "<a href=3D'$ScriptUrl/\$1'>\$0</a>";
> >    $LinkPatterns["ThisPage:($UrlPagePattern)"] =3D
> >      FmtPageName("<a href=3D'\$PageUrl/\$1'>\$0</a>",$pagename);
> >    $LinkPatterns["ThisGroup:($UrlPagePattern)"] =3D
> >      FmtPageName("<a href=3D'\$ScriptUrl/\$Group/\$1'>\$0</a>",$=
pagename);
> >=20
> > This does direct HTML substitutions for the ThisWiki/ThisPage/=
ThisGroup
> > links and bypasses the FmtUrlLink function altogether.  So, these =
references
> > won't be treated as external URL links (or InterMap links).
> >=20
> > This should work with all of the permutations of links and their =
double-bracket
> > counterparts.  It does assume that ThisWiki:, ThisPage:, and ThisGroup:=
 are
> > never used as image references; i.e., "ThisWiki:path/to/image.gif" won'=
t work.
> >=20
> > I'm going to skip the "display external references as endnotes" =
feature for=20
> > a moment--I think that's also doable, but I want to tackle this one in
> > baby steps if we can.
> >=20
> > So, does this approach address what you're trying to achieve?  What =
parts
> > other than endnotes does it leave out?
> >=20
> > Pm
> >=20
> >=20
> > _______________________________________________
> > Pmwiki-users mailing list
> > Pmwiki-users at pmichaud.com
> > http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> >=20
>=20
>=20
> _______________________________________________
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
>=20








More information about the pmwiki-users mailing list