[pmwiki-users] How much trouble are underscores in page names?

John Rankin john.rankin at affinity.co.nz
Tue May 16 17:49:23 CDT 2006

On Tuesday, 16 May 2006 8:43 PM, Felix E. Klee <felix.klee at inka.de> wrote:
>If I add the following array to config.php, then I do indeed get
>underscores in page names.
>  $MakePageNamePatterns = array(
>      "/'/" => '',                          # strip single-quotes
>      "/[^-[:alnum:]\\x80-\\xfe]+/" => ' ', # convert non-alnums to spaces      
>      "/(^\\w)/e" => "strtoupper('$1')",    # initial caps   
>      "/\\s+/" => '_'             
>  );
>* Many of the links included in the default wiki stop working.  How much
>  of a pain would it be to fix that?

I did an investigation into this scheme at one point. To make existing
links work, you need to create a local MakePageName function that checks
whether the standard wiki pagename exists, if the version with underscores
doesn't. There is a Cookbook.AlternateNamingScheme that implements this.
It means you can have a page called, for example, Apple_iMac which spaces
automatically to Apple iMac, instead of Apple I Mac.
>* What negative side effects should I expect from using the above
>  setting?

I think it's more a case of working the PmWiki way unless there is a
compelling reason to do otherwise. As you and Ben point out, the same 
effect can be achieved using (:title:) markup.
>Finally, I wonder whether I should just stick to the default CamelCase
>instead.  After all, it's a minor issue: To get well readable page
>titles, one can simply use the directive "(:title text:)", though most
>users probably won't.
And using [[free link]]s gives authors a lot of flexibility. I would
be cautious about changing something as fundamental as the page naming
scheme to address a "minor issue" -- the side-effects of the cure may 
turn out to be worse than the disease.

>From my investigation, I reached these conclusions:
- a page naming scheme using underscores can be made to work
- it's suitable for specialised applications with many pages where
  PmWiki's "natural" scheme produces undesirable results
- there is no free lunch -- when in doubt, follow the PmWiki way 

Hope this helps.
John Rankin

More information about the pmwiki-users mailing list