The following procedure can be used to add a gif image file to a stand alone wikit database (i.e. .tkd file). Note that images may only be viewed using the Tk interface currently. Support for the web (CGI) interface is in the suggestions box.
Assumptions
Procedure
% wikit -images scan wikit.tkd Scanning 17 wiki pages... 1 urls added, 0 urls deleted
% wikit -images local wikit.tkd 1 local images copied
Just tried it out (2005/04/12) with the latest wikit.kit and it did not work:
error: invalid command name "export" while executing "export LocalImages" (in namespace eval "::Wikit" script line 2) invoked from within "namespace eval Wikit { export LocalImages proc ScanForInlinedImages {{db wdb}} { array set inlined {} mk::loop c wdb.pages { set ..." (file "S:/Temp/wikit.kit/lib/wikit/image.tcl" line 8) invoked from within "source S:/Temp/wikit.kit/lib/wikit/image.tcl" ("package ifneeded" script) invoked from within "package require Wikit::Image"
(2005/06/08)TJC Seems a small typo causes the problem. Extract the wikit.kit and go to wikit.vfs/lib/wikit/image.tcl and edit the line reading:
namespace eval Wikit { export LocalImages
to read like:
namespace eval Wikit { namespace export LocalImages
And things should work right. Good luck.
wikit -image Options
How would you do it on windows? I got the following error when I tried it on windows.
couldn't execute "C:\dir\wikit": invalid argument
You could do it in a Tcl-script, I'm working on that myself. If you have access to a *nix system you can do the actual scan and add there and just copy the wikit.tkd file to your windows box. It is a metakit database-file and as such platform independent. - VL
30sep03 jcw - You could also use tclkitsh.exe, the command-line version of tclkit, and type "tclkitsh wikit.kit -images list wikit.tkd", etc.
26nov03 Came across this and thought I'd give it a try. Followed the instructions, added a gif image, and was able to view it in local mode. When I tried running the wikit in httpd mode, however, the image did not display in netscape. An old version of netscape showed a 'broken' image icon; netscape 7.0 didn't display anything. Is it possible to add images in local mode and then use the '.tkd file in server mode, or did I miss something (likely) in adding the image in the first place?
Ah, that'd make the story complete. Unfortunately, no: httpd mode was added more recently (first r/o, now also r/w), and no one has yet coded the logic to serve images from the local data. The first reason to get those images in was for embedded help wiki's. T'would indeed be nice to close that httpd gap... -jcw
Wow! Thanks for the quick reply. I'd love to help, but I'm really not sophisticated enough with TCL and web programming to handle it. I certainly do appreciate all the work you folks have done. As a personal wiki it works great!