[pmwiki-users] Automatic linking

Karl Loncarek dh2mll at web.de
Thu Feb 16 01:47:35 CST 2006


"Bellave Jayaram" <bellavejayaram at cox.net> wrote in
news:000c01c6324e$a51a9b20$0100a8c0 at indra: 

> Karl,
>      This feature has a lot in common with a Automatic
> Include{Page|Section|...} kind of feature that would greatly
> facilitate Content Reuse where the referenced content gets
> automatically included if it exists.
> 
>      In the case of a glossary, I am just wondering if there is a way
> that each entry could define a value in a global variable array and if
> there could be a markup such as (:autolink :) which would lookup each
> word in the page against that global variable and create the link if
> it hasn't done so already (it probably needs to keep track of
> modification time of each glossary entry too in the array so that only
> those entries that are later than the last time it ran are checked).
> This could still be quite slow. 

I'm assuming that each entry within a glossary will be located in a 
separate wikifile where the title of that file or page will be stored in 
a temporary file (to avoid opening each file every time (:autolink:) is 
used). The filedate of that file will be stored and the title of each 
file that has changed after the temporary file has been changed will be 
reread. I think this should give speed improvements especially on sites 
with lots of pages. I almost finished that part.

The next step will be to find out a good and fast way to replace the text 
by links in the wikitext. This will be the hard part, as all existing 
links should be kept and not changed. Also the largest text has to be 
replaced first. So I have to sort the array accordingly.

I still fear that the speed will be anything but fast. We'll see.

> 
[..]
> Jayaram

-- 
Bye
Karl (aka Klonk)





More information about the pmwiki-users mailing list