The Lower-Case Mistake

I’m doing a lot of of work on Cardigan Bay at the moment.

And it’s getting pretty good.

I wish I’d done all this sooner. I spent years with wikis, not writing my own wiki-engine because I thought that would be pointless reinventing the wheel. Then when I did, I realized I could make wikis do all the things I wanted from them.

Then I loved Clojure but kept writing my engine in Python because I thought it would be more straight-forward, a known art, and just quicker and easier.

Now I’ve bitten the bullet and moved to writing my wiki in Clojure (something that seemed yet another round of self-indulgence when I started it at the very end of last year) I realize that it’s exactly right, and Clojure is a super-powerful and easy language to do it in.

I’m making great progress and loving Cardigan Bay … (and very soon there’ll be a new release with lots of nice new features … watch this space.)

BUT …

somewhere along the line I have made a huge, huge mistake.

This goes back to my earlier engine, Project ThoughtStorms, I think.

Or maybe I inherited it from somewhere else. I can’t even remember.

The mistake is that wiki page names are obviously CamelCased for readability. A convention I like very much and continue to use.

But I decided to make the file-names all lower-case. In other words, I throw away the capitalization of the name.

The only place that the capitalization exists, is in the link that leads to a page. So links look OK. And from following a link, we can deduce the capitalization we show the next page.

Which works reasonably. But you’ll notice that in RecentChanges and other queries for OrphanPages etc. the pagenames are all lower-case. They have to be, the file system has no knowledge of the capitalization.

That was a pain, but I could live with it.

Now, though, I’m working on the “export this wiki as flat files” functionality. (Which is going to be fundamental to my new thinking … more on which later)

And I have same problem. Running through the directory of pages, I can render them beautifully, but I have no information as to how the pagename should be capitalized. And so can’t give the static pages a reasonable looking title.

That is an absurd restriction which I certainly can’t live with. (And nor will anyone else)

So what is to be done?

I could decide to store the correct page name somewhere else. Either in the page files themselves, or another database. But that breaks the convention that pages are pure markdown files (or slightly extended markdown files). I don’t want to add my own special header convention and force people to deal with that when migrating into or out of Cardigan Bay. It should be possible to work on CB wikis in your own preferred text editor if you choose.

Similarly, I don’t want to depend on another database.

Or I can try to capture the capitalized version of the names when I scan the links into the temporary database at the beginning of each session. And use that when exporting. Which will work for pages which aren’t orphans.

Or I do an export the way I used to back in SdiDesk, not by grabbing everything in the page-store, but by crawling it via the links. Which would give me the capitalized version of the pagenames.

Or maybe I need to change the convention so we don’t lower-case the file-names. But keep the capitalization. I’m tending towards this. But I have 5000 pages of ThoughtStorms in files whose names aren’t capitalized. And another 4000 in my personal wikis. That’s a lot of work to fix.

Anyway, thanks for listening dear reader … just writing this has been useful for me.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.