Version 16 of Adding Help to Scripted Documents

Updated 2003-03-08 11:01:03

July 2002 - Scripted documents are being renamed to Starkits.


If you want to use wikit to add a help facility to your Starkits, there are a few steps that will make it a relatively simple exercise.

Firstly, create a subdirectory called doc inside your appname.vfs/ directory and put your wiki datafile in there - for example lib/appname.tkd, where appname is the name of your application:

  mkdir appname.vfs/doc
  cp myhelpdir/wikit.tkd appname.vfs/doc/.

Then, you can display the wiki using the following commands, either from a menu or in your application startup script (this assumes a "package require starkit; starkit::startup" has been done in main.tcl):

  package require Wikit
  Wikit::init [file join $::starkit::topdir doc appname.tkd]

Note that the wiki will automatically be read-only, since a wiki file stored in a starkit cannot be modified.

To update your wiki datafile, unpack the starkit using sdx, edit it using wikit, then rebuild the starkit, thus

  sdx unwrap appname.kit
  wikit appname.vfs/doc/appname.tkd
  sdx wrap appname.kit

[EE]: Why can a wiki file stored in a starkit not be modified? When making a starkit, can one not 'sdx wrap <foo> -writable'?

It's tricky, because I haven't got all the logic of Metakit I/O right. The embarrassing part is that I had at one point. MK prefers to do memory-mapped file access. I need to look into this again, right now, the help system gets around things by slurping up the datafile into memory on open. It could write it back out ... as I said, I need to resolve this, it's not technologically hard. More a time issue. -jcw


[ Category Wikit | Category Tclkit ]