CAU 25-Nov-2005: I finally got around to putting this page together. Something I've been meaning to do for at least 6 months.
THP is a way of embedding Tcl into HTML.
The requirements were quite straight forward. Some features are fairly obvious, others less so:
<%tcl while {$i<10} { %><B>Repeated line</B><BR><%tcl } %>
Why THP? Well, it's a play on the PHP name - (T)cl (H)ypertext (P)reprocessor
I've been using THP now for a little while, tweaking where necessary, and think that it generally fits what it was supposed to do.
THP has been tested on:
I had some fun putting the starpack version together and figuring out IIS for the first time. Getting THP working with Tclhttpd outside of the cgi-bin directory was a challenge too, but it works a treat! ...more details to follow.
THP evaluates everything in an interp before returning any resulting HTML to the client. I've aliased the "puts" command to give more control (THP can be used in debug mode on the command line using filenames as arguments) and it removes the need to use "puts -nonewline" frequently. There's also an "include" command which is more flexible than "source" or "open" to include the contents of anthother script or text file at that point in the markup.
THP also reads a file named .thprc (or thp.ini on windows platforms) and interprets this before anything else, allowing the developer to set variables or redirects quite easily.
Check out a description and example at [L1 ]
See also: