item2
Next»

contents

 

Introduction - 1

Background - 2

Deployment - 3

Starkits - 4

Tclkit - 5

Advanced topics - 6

Repositories - 7

Server apps - 8

Who uses this - 9

Examples - 10

Conclusion - 11

 

Acknowledgements

References

6.6 - Adding help to a Starkit

You can use the WiKit package to add read-only documentation to a Starkit. WiKit is a Tcl implementation of a Wiki - a collaborative authoring tool. When used as a help system the documentation file is contained within the Starkits VFS and compressed along with other scripts and data.

To add WiKit to a Starkit, download the Wikit Starkit and use it to create the documentation file. By convention, documents are stored in a doc directory under the Starkit VFS:

    $ mkdir mykit.vfs/doc
    $ wikit mykit.vfs/doc/mydoc.doc

Note that Wikit contains its own help, and so is a good example of a Starkit help system.

Next, unwrap Wikit and copy the autoscroll, gbutton and wikit packages from the lib directory to your Starkit lib directory.

When required, your application can display the documentation using the following commands:

    package require Wikit
    Wikit::init [file join \
            $starkit::topdir dir mydoc.doc]

A common approach is to have your Starkit display the help documentation when it is started with no arguments. If you do this, the Starkit should be able to output console and graphical help, thus:

    if {[llength $argv] == 0} {
        if {[catch {package require Wikit}]} {
            # ... output console mode help
        } else {
            Wikit::init $path_to_wiki_datafile
        }
    }

You can even add a help Wiki to a package Starkit (such as Kitten). The starkit::startup package returns an indication of how the Starkit was launched:

  • starkit - called from a Starkit
  • starpack - called from a Starpack
  • unwrapped - called from an unwrapped Tcl script
  • sourced - the Starkit was sourced by another script

Use this in the main.tcl to detect if the package Starkit was launched by a user (or a program), or sourced by another Starkit:

    package require starkit
    if {[starkit::startup] eq "sourced"} return
    package require Wikit
    Wikit::init [file join \
            $starkit::topdir dir mydoc.doc]

see also

Starkit Home Page

Tclkit Home Page

Metakit Home Page

SDX Utility

Wikit Home Page

Tclers' Wiki

Author's Website

Updated paper, by Steve Landers, as presented at Tcl/Tk 2002 conference - see also original PDF.

Papers & Presentations