Version 1 of Adding Help to Scripted Documents

Updated 2002-06-25 18:53:58

If you want to use a wikit to add a help facility to your scripted documents, 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

         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 scripted document - 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 scripted document cannot be modified.

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

  sdx sd2fs appname.bin
  wikit appname.vfs/doc/appname.tkd
  sdx fs2sd appname

Category Scripted Document