Text_Wiki/YaWiki Hack

I just got done implementing what I think is a rather neat hack in Text_Wiki/YaWiki.

It is the ability to specify “paged” data. My reason for wanting this, is that I want to put a tutorial on the Cerebral Cortex Wiki but don’t want it to be one huge long page, or pages like CrtxDbTutotial1, CrtxDbTutorial2 etc.

I also wanted it to automatically have next/back links.

So heres what I now can do (ignore the line numbers :):

  1. ===1===
  2. Page 1 Here.
  3. All other formatting is respected
  4. ===2===
  5. Page 2 here
  6. ===3===
  7. Page 3 here
  8. ======

This produces (at first), this:

Page 1 Here.

All other formatting is respected

1 2 3 Next >>>

Where 2, 3 and “Next >>>” are linked approriately.

The links pass a “pageno” GET variable (which if not present or is not a page, defaults to 1) and they
show the appropriate content between ===$pageno=== and either ===$next_page=== or ======

I really like this, and it took me less than 30 minutes to implement (thanks to PEAR::Pager), most of which was spent going “Hunh?” over the Text_Wiki code – which, now that I understand it, is pretty damn nice!

I will be moving this hack to the live crtx.org wiki soon, and it will also feature in my revamped crtx.org :-)

– Davey