Adding Help to Scripted Documents

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/.

(Instructions on adding the wikit to your script)

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


Help! I want to integrate Wikit into the tclhttpd via ApplicationDirect URLs (loaded from /custom). I've first copied the routines from the wikit.vfs-lib to the tcl-lib-directory. Then package requiring Mk4tcl and Wikit, which gives the first confusion: the tk-gui appears because of the package require tk-command in wikit.tcl, which is unnecessary in this case, because tclhttpd is running in console mode. Then bring things up with Wikit::init sometkdfile -> next confusion: the Wikit-GUI appears mixed up with the tclhttpd-GUI in the (unwanted) Tk-Windows. My aim is to avoid CGI-process-overhaed in calling tclkit.exe wikit.kit xyz.tkd each time by fully integrating the procs into the tclhttpd!