[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

migrating a usemod Wiki from CamelCase to [[spaced links]]

Bil Kleb

12/9/2004 8:08:00 PM

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?

Thanks,
--
Bil Kleb, Hampton, Virginia
3 Answers

Austin Ziegler

12/9/2004 8:23:00 PM

0

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?

Not yet. Soon, I hope, but not until after the new year unless I get a
lot of time to work on it in the next few days (I'm doing an update
release of Ruwiki to fix a single bug -- and if I have a conversion
script, that too).

Ruwiki supports [[spaced links]] or even Spaced_Links, but does not
have a script that will automagically convert the references from one
form to the other. The page format, however, is open, and could be
changed easily.

-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca


Brian Schröder

12/9/2004 9:51:00 PM

0

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-sch...



Cameron McBride

12/10/2004 12:26:00 AM

0

> Of course, what I'd really like is a Ruby-powered Wiki. Is
> there a migration path for that leap?

I thought Dave's rublog could grok usemod data. I'm just reciting
from memory, so I could be wrong. (and I lazily didn't check the
facts ;)

Cameron