Help

Getting started

To create a new wiki - just run wikit specifying the name of the new wiki datafile as an argument, for example:

wikit my_wiki.tkd

To edit an existing wiki specify its name. If no name is specified, it defaults to wikit.tkd.

For more information on Wikit and editing your wiki see one of the following pages or the hints that follow

Setting the title case

Often you will want to have a link in lower case, but have the title of the referenced page capitalised. Wikit ignores case when following links - for example Help, Help and Help all refer to this page. So, you can create a page using a lower case link (see Formatting Rules above) then edit the referenced page and change the text of its title to dual case.

Changing the help button

The help button text comes from the first word of the page 3 title (i.e. this page). If you want to change the button text, change the title this page. Be careful not to make the length of the first word in the title too long - 8 characters should be plenty.

You can also make the Help button display a page other than the Help page. To do this, make the title a link to another page. For example, to have the help button display the Recent Changes page, set the title to [Recent Changes]. Undoing this change is a little tricky. You''l need to add a link to page 3 (i.e. [3]) in one of your pages, click that (which will display the help page, and then edit the help page to remove the link from the title. The change will take effect next time you start wikit.

Making a wiki read-only

If you want a a wiki to be "read-only" when displayed, change its Operating System file permissions to remove write access. Wikit will not display the Edit button unless the datafile can be written.

Adding a help wiki to your applications

Wikit can be used to provide read-only documentation within an application. This is particularly convenient if you are using [Starkit]s - the wiki datafile is contained within the starkit's virtual file system and compressed along with other scripts and data.

If you are using [TclKit] you can access the required libraries from within Wikit itself, using the following commands:

package require scripdoc mk4vfs::mount wikit wikit.bin -readonly scripdoc::extendPath wikit

... where wikit.bin is the path to the Wikit starkit.

Alternatively, you'll need to extract the autoscroll, button and wikit packages from within the Wikit starkit and add them to your application or your Tcl library path. You do this using the sdx command, thus: sdx unpackit wikit.bin

A wikit.vfs directory will be created with all the files unpacked. Copy the lib/autoscroll, lib/button and lib/wikit directories.

You'll also need to have the [Incr Tcl] extension available. This is built in to TclKit on most platforms, or can be added to any Tcl/Tk distribution. See http://wikit.tcl.tk/IncrTcl for more details.

When you have the three packages available, your application can display the wiki using the following commands.

package require Wikit Wikit::init $path_to_wiki_datafile

A common approach is to display the wiki when no options are supplied to your application, and to output both 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 } }

Note that there are two additional optional parameters to Wikit::init. The first specifies whether the wiki should be "read-only", and defaults to 1 (i.e. read-only). Set it to 0 if you want the wiki to be editable from within your application. The second specifies the window into which the wiki window should be packed, and defaults to the Tk toplevel window. You would not normally need to use either of these option parameters.

If you are packaging your application as a starkit have a look at [Adding Help to Starkits] for additional suggestions.