The Request: Add a URL to TWiki which generates a Links Database suitable for use with the
MeatBall:TouchGraphWikiBrowser
. (Also see
TouchGraph)
What is the Links Database?: A text file, or URL, which lists all the links (as topic names) contained within a topic name. It looks like this: (also see
MeatBall:LinkDatabase
)
TouchGraph WikiWebBrowser MeatballWiki TGLinkBrowser TGGoogleBrowser WebTopicList ArbitraryTextForWikiWordLinks
BreadSlicer YearTwo WikiWords FaqIndex TWikiAccess
AnotherPage WithTwoWikiWordLinks AndAnExternalLink http://example.com/
...etc...
Suggested URL:
https://www.twiki.org/cgi-bin/view/Codev/TGTopicList for a
single web database, and
https://www.twiki.org/cgi-bin/view/TGTopicList for an
all public webs database
Discussion
Not sure how
ArbitraryTextForWikiWordLinks could be handled but even without them this would make a killer add on for TWiki.
In conception this appears dead simple, how much work would it be to program?
--
MattWilkie - 22 Jul 2002
Just downloaded and tried
TouchGraph with a handseeded link file.
Yes, it is a killer!
A few details
- It's not (yet) as responsive as Personal Brain, but lightning fast compared to navigation in TWiki
- The browser (is that HotJava or what?) balks on TWiki's BleedingEdge <xyz ... /> tags ...
- ... and doesn't like JS / Frame stuff (can't say, JoachimDurchholz didn't warn me ;-)
Programmatically, it shouldn't be too complicated.
Although, a
clever integration into TWiki needs some thought.
I need a demo really fast,
so I put together a quick hack.
--
PeterKlausner - 23 Jul 2002
I've hacked together a crude
MeatBall:LinksDatabase
style text database for the TWiki web from the 2001-December release. To use:
- make sure you have the Java Runtime Environment 1.3 or newer installed (http://java.sun.com/j2se/1.4/download.html
)
- Download and unpack MeatBall:TouchGraphWikiBrowser
- Put the files Twiki.txt (attached) and Twiki.bat in the same directory.
- Run Twiki.bat (on unix edit the file so it starts with
#!/bin/sh and rename it to twiki.sh and then run it with ./twiki.sh )
twiki.bat:
java -cp TGWikiBrowser.jar;BrowserLauncher.jar com.touchgraph.wikibrowser.TGWikiBrowser twiki.txt http://twiki.org/cgi-bin/view/TWiki/ hypermedium 2 false
The script I used to extract the links is below and was run on a
CygWin installation of Twiki. The
WikiWord pattern matching is extremely simplistic.
gen_tglist.sh:
#!/usr/bin/bash
theList=TouchGraphTopicList
rm $theList
# for every text file in the current directory do...
for a in *.txt
do
# the topic being processed
echo -n $a | sed -e 's/\.txt//' >> $theList
# add a 3 space gap between the topic and it's links
echo -n ' ' >> $theList
# find and write out the WikiWords
egrep -UZo [A-Z]+[a-z]+[A-Z]+[a-z]+ $a | tr \\n ' ' >> $theList
# add a newline between the records (topic names)
echo ' ' >> $theList
done
Problems with this hack;
- External links are not in the database
- there are no links across Web boundaries (eg: you can't follow a link from TWiki/SomePage to Codev/ThisPage)
- I couldn't figure out how to specify the plain skin
- the script is very slow (and not in perl)
- it isn't live
- the generated LinkDatabase textfile is in alphabetical order, so instead of the first on-load-up page being TWiki/WebHome it is TWiki/AlWilliams which only has two child links. Not very exciting (no offense to Al meant).
- many, many more I'm sure : ) Feel free to flesh out the list.
--
MattWilkie - 23 Jul 2002
I put together a similar 80:20 hack; see the
attached screenshot,
which is centered around
WelcomeGuest
(you can supply the initial page as parameter).
From playing around,
it seems hard to cover more than one "web" in a
TouchGraph,
because you would always see the "web" prefix.
So I build one touchgraph.txt file per pub/web dir.
For a real solution, I see 3 approaches:
From the outside
- let twiki render as usual
- extract all the links
- match them and convert them into local or remote touchgraph references
Pros:
- Completely modular
- Catches absolutely definitely everything
Cons:
- External analysis is difficult, because the original function is not available any more
- Make sure to use a skin with 0 navigation
File based
MattWilkie's and my hack
- parse the files directly for all link patterns
- update touchgraph link list accordingly
Pros:
- Full control about what to link; this is imporatant, because the priorities for the graph are a bit different: e.g. you want to reverse the direction of the parenttopic link
- no navigational fluff
Cons:
- Each and every link generating function or plugin must be duplicated. Yep
From inside
- Render all pages in a special touchgraph mode
- Do not output text
- Only output link data
Pros:
- Should catch everything
Cons:
- Each and every link generating function must be modified, to generate touchgraph data...
- ... which might cost performance for regular rendering as well
- specialized rendering, e.g. for parenttopic seems harder
--
PeterKlausner - 24 Jul 2002
I reached a 90:10 solution and created
TouchGraphAddOn.
See
TouchGraphAddOnDev for further discussion.
--
PeterKlausner - 09 Oct 2002
Thanks for creating this, guys! Go
TouchGraph!
--
GrantBow - 16 Jan 2003