On Fri, 10 Dec 2004 05:12:27 +0900
Bil Kleb <Bil.Kleb / NASA.Gov> wrote:

> We have an internal usemod Wiki that prodominately uses
> CamelCase-style links.  However, it's topic is visual
> literacy and CamelCase is not easy for laypeople to visually
> digest.
> 
> Does anyone have a script for migrating from CamelCase to
> [[spaced links]]?
> 
> Of course, what I'd really like is a Ruby-powered Wiki.  Is
> there a migration path for that leap?
> 

I don't now nothing about usemod wikis, but if you can pipe the pages through
this script it converts it along your proposed lines:


$ cat camel_to_space #!/usr/bin/ruby print ARGF.read.gsub(/(([A-Z]\w*){2,})/) { '[[' + $1.gsub(/(\w)([A-Z])/, '\\1 \\2').downcase + ']]' }

$ echo "This text contains CamelCase DoubleDromedarCase and even rareCased text." | ./camel_to_space This text contains [[camel case]] [[double dromedar case]] and even rareCased text.
Regards, Brian -- Brian Schr?der http://ruby.brian-schroeder.de/