Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tcl/Tk and HTML

20 views
Skip to first unread message

David W. Nims

unread,
Jul 20, 1995, 3:00:00 AM7/20/95
to
I am a student at Wright State University, and I am in an Industrial Design
Clinic class that is offered here. Basically, we are using Tcl/Tk to write
a social interface similar in principle to Microsoft Bob. Whereas Bob is a
PC application, however, we are writing a UNIX application, and we plan to
make it available for students around here to use as an alternative to the
customary (and quite non-intuitive) shell command-line interface.

We would like to be able to have a hypertext-linked error and help subsystem,
so that whenever the user does something which leads to any sort of error
condition (such as trying to view a file that does not have adequate
permissions or something), a nicely formatted error message is displayed,
along with the option to view some appropriate help information. The help
info would be in HTML, so that the user could follow links from one point
to another in the document, and research related topics.

We could use a standard HTML client, such as Netscape, as the interface to
our help information, but we thought it might be nice to have Tcl/Tk itself
do this. I have the so-called "HTML parser in 8 lines of TCL" written by
Stephen Uhler (stephe...@eng.sun.com), which I plan to (attempt to)
analyze. But, is there any other native capability of Tcl/Tk for HTML
parsing, or does anyone have any suggestions on how we might go about
accomplishing our task?

Any help is much appreciated, and if possible should be sent to me via email
at the address given below.


David Nims
Student, Wright State University
dn...@cs.wright.edu

P.S. For anyone who has not yet seen Uhler's code, here it is:


proc HMparse_html {html {cmd HMtest_parse}} {
regsub -all \{ $html {\&ob;} html
regsub -all \} $html {\&cb;} html
set w " \t\r\n" ;# white space
proc HMcl x {return "\[$x\]"}
set exp <(/?)([HMcl ^$w>]+)[HMcl $w]*([HMcl ^>]*)>
set sub "\}\n$cmd {\\2} {\\1} {\\3} \{"
regsub -all $exp $html $sub html
eval "$cmd hmstart {} {} \{ $html \}"
eval "$cmd hmstart / {} {}"
}


Kudos to Mr. Uhler for dreaming up such a mess. :-)

Steve

unread,
Jul 28, 1995, 3:00:00 AM7/28/95
to
In article i...@alpha.wright.edu, dn...@alpha.wright.edu (David W. Nims) writes:
>We could use a standard HTML client, such as Netscape, as the interface to
>our help information, but we thought it might be nice to have Tcl/Tk itself
>do this. I have the so-called "HTML parser in 8 lines of TCL" written by
>Stephen Uhler (stephe...@eng.sun.com), which I plan to (attempt to)
>analyze. But, is there any other native capability of Tcl/Tk for HTML
>parsing, or does anyone have any suggestions on how we might go about
>accomplishing our task?
>

There is tkWWW. It provides a Tcl interface to the CERN WWW Library.
It is very heavyweight, especially for your application. I'd stick with
Stephen's library.

I am currently helping to develop the library, and also to build network
protocol handlers, etc, to complete the story. It's not quite ready for
release yet, but let me know if you're interested in having a look.


---
Steven Ball, PASTIME Project, ACSys CRC, ANU
E-mail: Steve...@pastime.anu.edu.au Ph. (06) 2495146
Snail-mail: Canberra ACT 0200, AUSTRALIA
He's not the messiah, he's a very naughty boy!

--
Steven Ball, PASTIME Project, ACSys CRC, ANU
E-mail: Steve...@pastime.anu.edu.au Ph. +61 6 2495146
Snail-mail: Canberra ACT 0200, AUSTRALIA
He's not the messiah, he's a very naughty boy!

0 new messages