[Pmwiki-users] Re: Single-Word WikiWords

Fabio Reis Cecin frcecin
Sat May 8 10:10:03 CDT 2004


On 8 May 2004 at 9:43, Patrick R. Michaud wrote:

> On Sat, May 08, 2004 at 11:33:43AM -0300, Fabio Reis Cecin wrote:
> > 
> > What about this approach -- I believe it could be used efficiently even for
> > non-capitalized single words ("java", "python", or all caps "PHP"...)
> > 
> > After a new version of any page is saved, it could be scanned for all 
> > single-words (any combination of A-Z, a-z) that are set as freelinks, 
> > and those words could then automatically be merged into a 
> > "singlewikiwords.txt" file 
> 
> IMO it's far easier and cleaner to scan the wiki.d/ directory for
> pages that have single-word pagenames than it is to scan the page text 
> searching for freelinks.  If needed for performance, the results of
> this search could be cached in a singlewikiwords.txt file.  OTOH, I
> think that scanning the wiki.d/ directory wouldn't take much longer
> than reading/processing a file, after all, by definition directory
> searches have to be fairly fast on any operating system.

certainly better to scan wiki.d/. somebody had mentioned that it 
would be slower, though. so if that is ever the case, my proposal 
is here.

>    2.  Why limit the banning of wiki words to just single wikiwords?
>        Better would be Main/BannedWikiWords, but see below...

of course! good idea.

> If one scans the wiki.d/ directory looking for single-word pagenames
> instead of keeping a singlewords.txt file, then deleted pages are no
> longer a problem.

yes, much better.

> > A "banned wiki words" page would also be useful for other purposes.
> 
> Keep in mind that PmWiki 0.6 already allows a site administrator
> to disable selected WikiWords or limit the number of times they
> are converted into links.  
> See http://www.pmichaud.com/wiki/Cookbook/DisableWikiWords.  
> However, I do see how it might be useful to have the disabling
> capability stored somewhere that non-admins can modify it.  There
> are some questions here--do we need to have a per-group version of
> this page?  How about per-site?

Main/DisabledWikiWords should be enough, I believe. groups of pages, 
at least where I'm using PmWiki, tend to use the same "vocabulary" 
(programming, etc.) so the annoying wiki words tend to be always the
same thoughout all the groups. better wait for someone to complain 
about the lack of per-group wiki word banning :-)

> Here's another approach that might work:  Instead of maintaining
> a single page containing the list of disabled WikiWords, how about
> indicating the disabling via the page itself.  This is a bit complex
> to explain, but suppose someone frequently uses the term "CamelCase"
> in a page but doesn't want it to be a WikiWord link.  Instead of 
> escaping [=CamelCase=] throughout the document or getting the admin
> to set $WikiWordCount['CamelCase'], they instead go ahead and create 
> a page called "CamelCase" and put [[wikiwordcount=0]] in the page 
> contents.  Later, when PmWiki is rendering a page that contains
> "CamelCase" in it, it first looks at the CamelCase page to see if it
> should be linked or not or how many times it should be linked.

Seems _perfect_ !

And if you really want to link to the page, then {{BannedWord}} and
{{bannedsingleword}} will do it, so it is still flexible.

Hopefully this will run fast.

Anyway it's good to create one of these "switch" PHP variables that 
allows disabling these features that scan wiki.d/ ...
$EnableWikiWordBanning = [0, 1];   // ?

- Fabio



More information about the pmwiki-users mailing list