Version 9 of Adding Help to Scripted Documents

Updated 2002-11-13 23:00:27

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, add the following two lines to your bin/main.tcl startup script

  set topdir [file dirname [file dirname [info script]]]
  lappend auto_path [file join $topdir lib]

The first line saves the root directory of the starkit - we'll use this later to locate the wiki help datafile. The second line makes sure the autoscroll, button and wikit packages can be found.

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

Then, you can display the wiki using the following commands, either from a menu or in your application startup script

  package require Wikit
  Wikit::init [file join $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 unpackit appname.bin
  wikit appname.vfs/doc/appname.tkd
  sdx packit appname

Category Scripted Document Category Wikit Category Tclkit