This is the historical archive of the now-inactive 'grubstreet' list.
Discussion on OpenGuides development
has now moved to OpenGuides-Dev.
Discussion on The Open Guide to
London now takes place on OpenGuides-London.
Re: [grubstreet] Wiki indexing patch
[prev] [thread] [next] [lurker] [Date index for 2002/5/10]
From: Ivor Williams
Subject: Re: [grubstreet] Wiki indexing patch
Date: 00:47 on 10 May 2002
Subject: Re: [grubstreet] Wiki indexing patch
Date: 00:47 on 10 May 2002
This is instead of the existing patch __patch follows__ 794a795,807 > sub GetIndexLink { > my ($id,$prefix) = @_; > $prefix ||= ''; > my $name = $prefix.$id; > > $id =~ s|^/|$MainPage/|; > if ($FreeLinks) { > $id = &FreeToNormal($id); > $name =~ s/_/ /g; > } > return &ScriptLink("id=$id&action=index", $name); > } > 827c840 < my ($id, $name) = @_; --- > my ($id, $name, $prefix) = @_; 849a863 > return &ScriptLink("id=$id&action=index",$prefix.$name) if $prefix; 856a871 > return &ScriptLink("id=$id&action=index",$prefix.$name) if $prefix; 963c978 < $result .= $q->h1($header . &GetSearchLink($id)); --- > $result .= $q->h1($header . &GetIndexLink($id)); 1205,1206c1220,1221 < s/\[\[$FreeLinkPattern\|([^\]]+)\]\]/&StorePageOrEditLink($1, $2)/geo; < s/\[\[$FreeLinkPattern\]\]/&StorePageOrEditLink($1, "")/geo; --- > s/\[\[(\+|>)?$FreeLinkPattern\|([^\]]+)\]\]/&StorePageOrEditLink($2, $3, $1)/geo; > s/\[\[(\+|>)?$FreeLinkPattern\]\]/&StorePageOrEditLink($2, "", $1)/geo; 1441c1456 < my ($page, $name) = @_; --- > my ($page, $name, $indexLink) = @_; 1450c1465,1466 < return &StoreRaw(&GetPageOrEditLink($page, $name)); --- > $indexLink = '>' if $indexLink; > return &StoreRaw(&GetPageOrEditLink($page, $name, $indexLink)); 2910c2926,2928 < print &GetHeader('', T('Index of all pages'), ''); --- > my $id = &GetParam('id'); > my $head = 'Index of '.($id || 'all pages'); > print &GetHeader('', T($head), ''); 2912c2930,2936 < &PrintPageList(&AllPagesList()); --- > my @PageList=&PageIndex($id); > if (@PageList) { > &PrintPageListIndented(@PageList); > } else { > print "<h3>No Pages Found</h3>"; > } > &PrintOuterIndices($id) if $id; 3049a3074,3085 > > sub PrintPageListIndented { > > foreach (@_) { > /(^|\+)([^+]+)$/; > my $pagename = $2; > my @plusses = /\+/g; > print "..." x @plusses; > print &GetPageLink($pagename), "<br>\n"; > } > } > 3418a3455,3514 > sub PrintOuterIndices { > my ($id) = @_; > my (%appearsOn); > > &OpenPage($id); > &OpenDefaultText(); > my $txt = $Text{'text'}; > > foreach my $refer ($txt =~ /\[\+(.+?)\]/g) { > $refer = &FreeToNormal($refer); > $appearsOn{$refer}++; > } > return if !%appearsOn; > print "<HR>\n"; > print &GetIndexLink($_,'>'),"<BR>\n" foreach (sort keys %appearsOn); > } > > sub PageIndex { > my ($string) = @_; > my ($name, %found); > my (%appearsOn); > > foreach $name (&AllPagesList()) { > &OpenPage($name); > &OpenDefaultText(); > my $txt = $Text{'text'}; > > foreach my $refer ($txt =~ /\[\+(.+?)\]/g) { > $refer = &FreeToNormal($refer); > push @{$appearsOn{$refer}},$name; > > $found{$name}++ if !$string > || $name eq $string > || $refer eq $string; > } > } > > my $goAgain = 1; > while ($goAgain) { > $goAgain = 0; > foreach (my @k = keys %found) { > my ($parent) = /([^+]+)$/; > foreach my $child (@{$appearsOn{$parent}}) { > next if /(^|\+)$child(\+|$)/; > next if $found{$_.'+'.$child}; > $found{$_.'+'.$child} = 1; > $goAgain++; > } > } > } > foreach (my @k = keys %found) { > while (/\+/g) { > delete $found{$'}; > } > #delete $found{$_} if !/^$string/; > } > > sort keys %found; > } > 3691c3787 < } elsif (/^\=(?:\[\[)?([^]=]+)(?:\]\])?\=(?:\[\[)?([^]=]+)(?:\]\])?/) { --- > } elsif (/^\=(?:\[\[\+?)?([^]=]+)(?:\]\])?\=(?:\[\[)?([^]=]+)(?:\]\])?/) { 3693c3789 < } elsif (/^\|(?:\[\[)?([^]|]+)(?:\]\])?\|(?:\[\[)?([^]|]+)(?:\]\])?/) { --- > } elsif (/^\|(?:\[\[\+?)?([^]|]+)(?:\]\])?\|(?:\[\[)?([^]|]+)(?:\]\])?/) { __End of patch__ ----- Original Message ----- From: Ivor Williams <ivor.williams@xxxxxxx.xx.xx> To: <grubstreet@xxxxxxx.xxxxx.xx> Sent: 09 May 2002 22:59 Subject: Re: [grubstreet] Wiki indexing patch > > > Kate L Pugh <kake@xxxxx.xx> wrote: > > >> Ivor, did you see my previous mail discussing problems with the patch? > > > > Just a few notes on initial testing: > > > If you try to index something (eg by URL munging) that doesn't have > > any results, the page is just blank; it doesn't say "no results". > > See for example > > http://the.earth.li/~kake/cgi-bin/wikibeta.pl?id=Marmalade&action=index > > OK, making it say "no results" is quite easy to do. I will do so. > > > If you do a plus-link (+Foo) to a nonexistent page, then it displays > > as Foo? where the ? is a link to edit the page -- there is nothing to > > click on to index it. I'm not sure whether this is a bug or a > > feature; I'd say the former, since it breaks the expected behaviour of > > a plus-link -- as I understand it, the plus links are about indexes > > rather than pages. See for example > > http://the.earth.li/~kake/cgi-bin/wikibeta.pl?Chinese_Food > > This was intended as a 'feature'. However, thinking about it, why does an > index have to have a real page? > > This will probably require a refactoring of my change to the freelink > handling code - but it's doable. > > > I can't seem to make the second kind of link (>Foo) work at all; see for > > example > > http://the.earth.li/~kake/cgi-bin/wikibeta.pl?Vegetarian_Food > > Ah, oops! A debugging I will go. > > Will post when I have a new patch ready. > > By the way, any thoughts about version numbers? It might make discussion a > bit easier. > > Ivor. > > > -- > grubstreet mailing list > grubstreet@xxxxxxx.xxxxx.xx > http://london.openguides.org/old-list-archives/ -- grubstreet mailing list http://london.openguides.org/old-list-archives/
-
[grubstreet] Wiki indexing patch
IVOR WILLIAMS 00:01 on 02 May 2002
Content-Type: text/plain; charset=ISO-8859-1-
Re: [grubstreet] Wiki indexing patch
Kate L Pugh 13:29 on 02 May 2002
Cool, thanks. Earle, can I have a current tarball of grubstreet's-
Earle Martin
14:12 on 03 May 2002
Can do. I'll send it to you over irc. -
Kate L Pugh
11:16 on 09 May 2002
And he sent me one, and I have put it all up at- too deep to show
-
Earle Martin
14:12 on 03 May 2002
-
Re: [grubstreet] Wiki indexing patch
Kate L Pugh 13:49 on 02 May 2002
Just a few notes on initial testing: -
Ivor Williams
00:47 on 10 May 2002
This is instead of the existing patch-
Ivor Williams
00:56 on 10 May 2002
794a795,807- too deep to show
-
Ivor Williams
00:56 on 10 May 2002
-
Re: [grubstreet] Wiki indexing patch
Kate L Pugh 13:29 on 02 May 2002
-
Re: [grubstreet] indexing patch 2
Ivor Williams 00:43 on 19 May 2002
---
[grubstreet] Others working on table of contents stuff for Wiki
Ivor Williams 01:33 on 19 May 2002
http://www.usemod.com/cgi-bin/mb.pl?TableOfContents -
[grubstreet] New use of indexing mechanism: ratings
Ivor Williams 15:09 on 19 May 2002
Index of home pages. Just put [[+Home page]] at the bottom of your home page.
-
[grubstreet] Others working on table of contents stuff for Wiki
Ivor Williams 01:33 on 19 May 2002