The script on this page, wikihist.cgi, provides a revision history of pages on a [Wikit]-based wiki. It displays a list of all the revisions of a page, and can show the differences, in [WikiDiff] format, between the current page and a specific revision of that page, or between a specific revision of a page and its previous revision. The script relies on four other files. The files are: * utils.tcl: from [Wikit] * format.tcl: also from [Wikit] * worddiff.tcl: from http://pascal.scheffers.net/wikidiff/worddiff.tcl.txt (see [WordDiff] for an explanation) * wikihist.css: actually just a renamed copy of [PS]'s wikit.css at http://pascal.scheffers.net/wikidiff/wikit.css The first three files are sourced into the main script, while the CSS file is pointed to by the generated HTML. To avoid cluttering your CGI directory, it would make sense to wrap these up into a [Starkit]. The script assumes that the Wiki pages have been checked into CVS, and that a directory where the pages can be checked out to exists. This script could probably quite easily be modified to use the tclhist archive, but that is left as an exercise to the reader! OK, the writer has performed the exercise -- see [Wiki Revision History Feature via tclhist]. To deploy this script at another site, you should make the following changes to the script: * replace the initial "exec /home/wiki..." line with the path to your Tcl interpreter * replace all instances of "/usr/local/bin/cvs" with the path to your version of CVS. I didn't just use "cvs" because /usr/local/bin wasn't in the PATH of our webserver. * replace any references to "http://saskatoon/..." with appropriate references for your site * make sure any references to wikihist.css point to your own CSS file * replace the line "cd /home/wiki/wikit/wikipages-co/wiki/daily" to change to a directory where you can check out the Wiki pages from CVS * and I think that's it. Once you've got it installed, point your browser to http://where.ever.you.put.it/wikihist.cgi to get usage instructions. Basically, you can: * get a revision history of a specified page. For example, "wikihist.cgi/12" gets you the history of page 12. * retrieve an old revision of a specified page. For example, "wikihist.cgi/12.5" gets you revision 1.5 of page 12. * compare the latest revision with a specified revision. For example, "wikihist.cgi/12-5" compares the latest revision of page 12 with revision 1.5, and displays it in [WikiDiff] format. * compare two specified revisions. For example, "wikihist.cgi/12-5-2" compares revision 1.5 of page 12 with revision 1.2, and displays it in [WikiDiff] format. If you get errors, you can get your browser to show what they are by enabling the debugging at the end of the script (change "if 0" to "if 1"). This can be integrated into the regular web interface to the Wiki by a short change to web.tcl in the Wikit distribution. After the line that reads: set updated "Updated [cgi_font size=-1 $date]" add the following line: append updated " [nbspace]-[nbspace] Revision History" ----