Monday, June 6, 2011


While browsing around for Javascript code that I could re-use in my image script, or at least learn from and reimplement, I happened upon a site that had another article that suggested that all developers should have a TiddlyWiki.

What is a TiddlyWiki?  Well, it's a wiki.  Contained within a single file.  Intrigued at the possible simplicity, I grabbed a copy.

They boast that you don't even need a web server for it, which is neat, but I'd much rather have each of my computers specialized for purpose.  No content hosting should happen on my desktop box.  So, I dropped the file on my server, which for the uninformed runs on my local network.

Browsing around I noticed they have some custom terminology in play.  Specifically, your wiki articles are called "tiddlers".  TiddlyWiki works differently from most other wikis in that you can have multiple tiddlers loaded in the page at once.  It also has some slightly different wiki markup, but there's a pretty good reference for that.  They also don't like to use spaces in tiddler names for some reason, even though they work just fine.  I guess I'll just use it as "no spaces, camel case = system page", and title all of mine so they're more easily readable.

Initially I was very confused.  The GettingStarted tiddler says "oh yeah you'll want to go to all these places and change stuff", so I went to those places to change stuff, but everything was read only.  After much searching of documentation, I found that there was an option in the AdvancedOptions tiddler that when disabled enables editing via HTTP.  So I enabled that and went on my merry way changing things and documenting my image script.

Then it came time to save.  Apparently by default it doesn't save your changes permanently as you make them, rather, there's a link you have to click to do a "master save", and an option you can enable to make it automatically save.  Clicking the "save changes" link to do the "master save", I was confronted with a confusing error dialog that said I would need to save my TiddlyWiki to a file before I could save.  Once again, I went searching to figure out how to "save my TiddlyWiki to a file".

This is where I ran into the biggest case of fail.  Apparently, even though I have the extra and optional TiddlySaver.jar, it can't save changes when the file is loaded from a web server.  So essentially, I lost everything I'd worked on, all because I don't want a copy of it on my local hard drive that I actually edit, and then a copy of it on my server that I just ignore because there's a copy of it on my local hard drive.

TiddlyWiki supports plugins, so I figured "hey, maybe there's already a plugin to make this work."  After a while of browsing plugins I came across one that would use WebDAV to enable saving server-side, all without me having to have files on my desktop's hard drive or add anything extra to the TiddlyWiki directory.  The only trick: you have to be able to save to the TiddlyWiki in order to install it.

I solved that by quickly chucking my TiddlyWiki into a network share on my server that I have configured as a network drive in Windows.  Loaded that up in Firefox, and now of course it would let me save.  I installed the plugin (which is as simple as copy/pasting the code into a new tiddler and tagging it systemConfig), then put it back in the original directory I had it in.  After refreshing and having it still not work, I derp'd and enabled WebDAV in my web server (and set it up for the directory), which wasn't too difficult.  Now I finally have the ability to save.

If you use it as it's originally intended, to be loaded off of your computer's hard drive, via the file:// protocol, it will work as intended without this extra step.  But if you're like me and have a personal server you want to install it on, you'll need to do it.

Now, excuse me while I go rebuild my documentation for my image script.

The verdict: Setup may be tricky (as I described, and for that reason only), but overall it looks incredibly useful.

No comments:

Post a Comment

I moderate comments because when Blogger originally implemented a spam filter it wouldn't work without comment moderation enabled. So if your comment doesn't show up right away, that would be why.