Note: CamelCase will be made optional in the forthcoming 1.3 release. See Ticket:191 for further information


A quick but simple non CamelCase hack



Why?


See Also

Some cool, smart and creative people like to avoid CamelCase. Come on, if you plan to use WikkaWiki for your homepage, or a blog or something - then it would be sooo uncool having CamelCase'd pages. Even more people would think that CamelCase'd usernames on the aforementioned websites (or in "normal" wikis, too) would be so 200? oh, wait. What year are we in again?

What?


Ok. CamelCase isn't mandatory for pagenames, you'd just have to make the links inside double brackets ([[likethis]]) all the time. No need to change that, works like a charm.

WikiName is a different matter. For one, you are restricted from making them. That needs to be solved.

The "You are WikiName" thingey up above the content (or elsewhere, depending on styling and/or mods) isn't a link...

How?


You need to edit the Wakka.class.php file located in the folder ./libs/ (relative to your installation directory).

Change the line (around 1215):
    function IsWikiName($text) { return preg_match("/^[A-Z,ÄÖÜ][a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/", $text); }


to the more understanding (as in "It knows I don't want CamelCase!" ;) ):
    function IsWikiName($text) { return preg_match("/^[a-z][a-z0-9]*$/i", $text); }


This allows usernames starting with a-z (lower or uppercase), and continuing with a-z (upper or lowercase) or numbers.

To make the "You are..." link a link, find in ./actions/header.php (relative to your wikka directory) near line 52:

            echo "You are ".$this->Format($this->GetUserName());


and change it to:

            echo "You are ".$this->Link($this->GetUserName());


This was something that bothered me in the first place, it might or might not be fixed in the next release (1.1.7).


CategoryUserContributions
Comments
Comment by DarTar
2006-10-18 11:39:16
Tormod,
I suggest we should declare character spans as constants and then allow users to modify their configuration by changing these chunks in the regex patterns instead of fiddling with regex themselves. See for instance what Wikini is doing (I think we should do something similar):

http://cvs.gna.org/cvsweb/wikini/wakka.php.diff?r1=1.90;r2=1.91;cvsroot=wikini;f=h
http://cvs.gna.org/cvsweb/wikini/formatters/wakka.php.diff?r1=1.45;r2=1.46;cvsroot=wikini;f=h
Comment by ShaunC
2006-10-18 21:34:18
Is there a way to tell Wakka not to interpret a CamelCased string as a link? For example, I might want to talk about FreeBSD without having the operating system's name turned into a "Create This Page" link. Apologies if this is in the docs; I searched on "ignore" and didn't find anything that appeared relevant.
Comment by BrianKoontz
2006-10-18 22:14:59
Shaun, you can escape any string from being processed by the Wikka parser by enclosing it in pairs of double quotes ( ""FreeBSD"" ). This also works when you want to include HTML snippets in a Wikka page. I put a couple of examples in the Sandbox.
Comment by ShaunC
2006-10-20 01:16:45
Brian, thanks, this is exactly what I was looking for. And apologies for calling it Wakka. :)
Comment by IsaacLW
2010-07-16 07:59:19
in my version: 1.2, the file "./actions/header.php" doesn't exist.
Comment by DarTar
2010-07-16 09:19:08
IsaacLW, please consider that CamelCase will be optional in the forthcoming release, 1.3

The header file can now be found (as of 1.2) in this folder: /templates/[theme name]/header.php
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki