[Pmwiki-users] Re: Single-Word WikiWords

Patrick R. Michaud pmichaud
Sat May 8 09:43:36 CDT 2004


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 (if they already exist in the file, nothing 
> happens).

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.

> (1) To ban certain single wiki words, use a public 
> Main/BannedSingleWikiWords [...]

Two answers:
   1.  For consistency, one should be able to disable or limit conversion
       of SingleWikiWord links using the $WikiWordCount array, 
       same as is currently done for multi-wiki words.
   2.  Why limit the banning of wiki words to just single wikiwords?
       Better would be Main/BannedWikiWords, but see below...

> (2) To deal with pages that don't exist anymore (deleted by an admin):
> [...]

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.

> A "banned wiki words" page would also be useful for other purposes.
> Sometimes I use CamelCase words that are NOT intended to become
> page names. Having a browser-editable page to ban these words 
> would be useful as it saves the user from finding each word and 
> typing [=BannedWikiWord=] . 

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?  

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.

Comments?

Pm



More information about the pmwiki-users mailing list