Version 4 of Wikit vfs

Updated 2004-06-06 22:44:54 by CMCc

A Wikit tcl vfs.

Code at http://sharedtech.dyndns.org/~colin/vikit implements a read/write tcl virtual file system over a Wikit formatted starkit, aka a .tkd file.

At the moment, the code requires a modified wikit, to be found at http://sharedtech.dyndns.org/~colin/wikit , but it is hoped that eventually these changes will be rolled into the wikit distribution.

It's a work in progress, but should eventually lead to the ability to directly support Wikit under Tclhttpd.

06jun04 jcw - Great! I've folded your one-line change into wikit, so the CVS repository and wikit.kit should be ok now. Apart from being just plain cool, this might also help find out to what extent a VFS driver layer affects overhead. Another interesting side is that this may help us come up with a good way to define plug-ins for tclhttpd, when both tclhttpd itself and the functionality to be plugged into it is a starkit - maybe there's an intersection with TIP 189 (modules) waiting to be discovered here?

CMcC - The matter of tclhttpd plugins is an interesting one. At the moment, you can drop things into (usually) /usr/lib/custom, and if they're .tcl files they're sourced. One of the simple supplied custom modules is dodirs.tcl which loads any directory in custom/ containing a startup.tcl file (this was with a view, and by analogy to, running starkits unpacked from custom/) it would be very easy to write a starload.tcl in custom which loads wrapped starkits into tclhttpd's directory and proc namespaces, to add functionality to the running server.

I haven't done much on it yet, but it would obviously be good for vikit to load|source a starkit-wrapped wikit instead of needing to unwrap it in situ, and that's something I intend to do. If you like (when vikit's tested and functional) you could add vikit.tcl to the wikit starkit, and get a self-attaching wikit.

Some Q&D documentation: the wikit is in essence a flat collection of id:(title,page,who,date) records, but is habitually searched by supplying a title or keyword to be searched for. In vikit, id is treated as a file name, and titles and keywords (distinguished by trailing '*') are treated as the file names of synthetic directories containing the names of all the records matched. Appending '!' to a record number yields a directory of pages referencing that record. Appending a '@' to a record number yields the file in its original format, leaving it naked yields the file rendered in HTML.

TODO: make the choice of rendering easier - so one could return Tk formatted output, make it an error to open an *@ file for anything but reading. Load wikit code directly from starkit/packed form.