== Extending tcl to generate html == [CMcC] Following from [jenglish]'s comment: why learn to use a monster HTML-template library when you can, with a few lines of code, extend the base language so you can write things like [[ href "/home.html" { ! "Home" }]] ... I wrote the following to do just that using the techniques in [let unknown know]. package require know know {[string match <*> [lindex $args 0]]} { set tag [string trim [lindex $args 0] "<>"] ::proc ::<$tag> {args} [string map [list @T $tag] { set result {} foreach {n v} [lrange $args 0 end-1] { lappend result "$n='[armour $v]'" } return "<@T [join ${result}]>[lindex $args end]" }] return [eval $args] } ---- ''[escargo] 7 Jun 2007'' - Is there really a "know" package available somewhere, or is this just presupposing that code from [let unknown know] has been sourced in somewhere? ---- This will generate a proc for any command like [[
  • ]] which will do pretty much what you'd expect it to. It could be extended to handle something like: [[ {tr-alist} {td-alist} args] which would use the [join] trickery below to generate a table row. [[