Создано: 02-08-2011 00:00:09  Метки: html tcl
Данная библиотека появилась пару лет назад на примерах Печникова. Под себя я правда переписал...
Вот пример кода:
#! /usr/bin/tclsh
source config/cfg.cfg
test_cookie
doctype
html {
 siteheader "Iconez" lite
 body {
  cms-menu
  sidebar
  if ![guest] {
    div -class main -style text-align:center {
      h3 {puts "Прикрепленные ярлычки:"}
      hr
      table {
        foreach lin [exec ls images/ | grep "16x16.png$"] {
          tr {td {img -src /images/$lin -width 32px -height 32px}
            td {puts /images/$lin}
          }
        }
      }
    }
  }
  sitefooter lite
  }
}

А вот библиотека:
package provide html2 1.0
namespace eval ::html2:: {
    namespace export *
}

# шаблон для генерации стандартного html-тэга
proc ::html2::tag {name args} {
  set name [string range $name [expr [string last : $name]+1] end]
  if [expr [llength $args]%2] {
    set opts [lrange $args 0 end-1]
    set b [lindex $args end]
  } else {
    set opts $args
    set b ""
  }
  puts -nonewline "<$name"
  foreach {argname argvalue} $opts {
    if [regexp " $argname " " -checked -hidden -readonly "] {
      if {$argvalue ne "0"} {puts -nonewline " [string range $argname 1 end]"}
    } else {puts -nonewline " [string range $argname 1 end]=\"$argvalue\""}
  }
  ### для незакрывающихся тегов
  if ![regexp " $name " " area base basefont col frame param meta link img input hr br "] {
    puts -nonewline ">"
    uplevel 1 $b
    puts -nonewline "</$name>"
  } else {
    if {$name eq "img" && ![regexp -- "-alt" $opts]} {

      puts -nonewline " alt=\"\""
    }
    puts -nonewline ">"
  }
}

foreach name {html meta title body head style link script form textarea input table thead tfoot tbody tr td th
  center a font button div span p img label ol ul li b i u s strong em h1 h2 h3 h4 h5 h6
  br hr var code kbd tt samp pre acronym embed header footer dd dt video audio} {
  proc ::html2::$name args {
    set name [lindex [info level 0] 0]
    uplevel 1 html2::tag $name $args
  }
}

proc ::html2::doctype {} {
  puts {Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">}
}

proc ::html2::html5 {} {
  puts {Content-Type: text/html; charset=utf-8

<!DOCTYPE html>}
}

1426 просмотров 0 комментариев

Создано: 11-03-2010 18:47:06 изменено: 18-06-2012 21:33:34  Метки: html
from http://html.find-info.ru/html/024/element.htm
1414 просмотров читать далее 0 комментариев

Создано: 11-03-2010 18:33:20 изменено: 18-06-2012 21:35:39  Метки: html
1371 просмотров читать далее 0 комментариев

Создано: 06-07-2009 12:11:15 изменено: 20-12-2009 10:50:14  Метки: tcl cgi css html sql
Попробовал написать несложное cgi-приложение используя средства tcl, sqlite, css и html. Вот что получилось:
1678 просмотров читать далее 0 комментариев

Создано: 31-03-2009 22:08:15 изменено: 26-06-2009 06:24:47  Метки: html
451 просмотров 0 комментариев

Создано: 31-03-2009 22:06:05 изменено: 11-07-2009 20:53:57  Метки: html color
1421 просмотров 0 комментариев

Создано: 31-03-2009 22:05:00 изменено: 26-06-2009 07:34:22  Метки: html
1452 просмотров 0 комментариев