create new tag
, view all tags
Why aren't normal text phrases (non-WikiWords) auto-linked to their corresponding topics?

PS: I put an implementation question into the developer's FAQ at HackingOutWikiAnnoyance (with the code mods I did) due to the fact that I already hacked our Twiki.pm to do this and wanted some advice on how to do it right. I'm putting this here due to the fact that it really should be a standard feature of all Wiki-type systems.

-- JamesBowery - 08 Feb 2005

Well, for one, history, and for two, because it is deceptively a complex problem.

"This is a phrase about WikiWords and Non-WikiWords which should be auto-linked."

On a hypothetical wiki site in which the previous sentence appears there are the pages [about WikiWords], [WikiWords], [WikiWords and Non-WikiWords], [Non-WikWords], [Non-WikiWords should be auto-linked], and [auto-linked].

Now which of those 6 pages should the sentence link to? How does a program decide which ones are most relevant and which are not (and thereby shouldn't be linked to)?

Last summer there was somebody working on this. I don't know far he got but it did sound like he made some progress. Search the TWikiIRC logs.

-- MattWilkie - 08 Feb 2005

TravisBarker and I are interested in this, but i'm not activly persuing it - we need to reverse the way we do topic linking * right now we look though a topic to find linkable words, and then look to see if they exist

  • while to do arbitary phrase linking, you have to get a list of all existant topics, and then search the topic repeatedly for each topic

-- SvenDowideit - 09 Feb 2005

MattWilkie, if you take the code mods I did, you'll see they are just a few lines and they pretty much embody the behavior desired. The problem is resolved by:

  • Using WikiWordSyntax (no dashes, spaces or underlines) as canonical for topic names, and then letting people use the non-canonical variants in the body text
  • Sorting canonical topic names by length into a single regex so that longest are matched first.

Now, whether this is the best way to implement it or not is my developer's FAQ question at HackingOutWikiAnnoyance. Certainly I left at least one minor bug -- see below.

-- JamesBowery - 09 Feb 2005

SvenDowideit, do check out the code mods I provide at HackingOutWikiAnnoyance. They do the job more or less. The main problem is some of the topics are linked to the wrong webs but everything else pretty much works.

-- JamesBowery - 09 Feb 2005

I'm currently working on the rename topic code, and this might be one of the few places where your code causes trouble ... otherwise, its an interesting approach!

-- SvenDowideit - 10 Feb 2005

I wouldn't worry about renaming. I just had to do a topic renaming in my web and it did indeed break one of the normal text auto-links but if people care about it that much they can always go to the trouble of using the normal forced link syntax.

-- JamesBowery - 10 Feb 2005

trouble is, you might not worry, but if we take this feature to its final conclusion, and users never use WikiWords in text, then rename must work (somehow) - possibly with some kind of edit section mechanism so that they can re-write the sentences in a logical way. also, when we use multiple links spanning a phrase, and rename one of the links, the phrase will need some heavy magic to still work like before (which again is alot of manual work for the user.

-- SvenDowideit - 11 Feb 2005

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2006-03-09 - CrawfordCurrie
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.