1 #!/opt/openisis/tcl/bin/tspr print
3 mikidoc Tcl server page
4 $Id: miki,v 1.5 2003/06/10 11:02:11 kripke Exp $
14 set len [gets $fid line]
16 set c [string index $line 0]
17 set tab [expr {"\t" == [string index $line 1] ? 2 : 1}]
18 if {$code && "$" != $c} {
19 set line [::openIsis::2html $line]
21 switch -- $c "" { # empty
25 set line "</pre>"; set code 0
27 set line "<pre>"; set code 1
31 if { 1==$tab && 2<$len && " " != [string index $line 1]} {
32 set i [string first "\t" $line]
35 set anchor "<a name=\"\
36 [string range $line 1 [expr $i-1]]\"> </a>"
39 set line "</td></tr><tr><td bgcolor=\"#CCCCCC\"><b>\
40 [string range $line $tab end]\
41 </b>$anchor</td></tr><tr><td align=\"justify\">"
43 if [string match ---* $line] {
46 set line "[expr {1 == $in ? "</li>" : "<ul>"}]<li>\
47 [string range $line $tab end]"
48 if {40 > $len} { append line "<br/>" }
54 set l "<table>\n<tr bgcolor=\"#EEEEEE\">"
60 foreach cell [split [string range $line $tab end] "|\t"] {
61 append l "<$td>$cell</$td>"
67 if {"\t" == $line} { append line "<br/>" }
70 foreach {ref name} [split [string range $line $tab end] "\t"] break
71 if {"" == $name} { set name $ref }
72 set line "<a href=\"$ref\">$name</a>"
74 if [string match ...* $line] {
75 set notes [string trim [string range $line 3 end]]
85 if {$in != $is} { # close where we
87 1 { puts "</ul>\n" } \
88 2 { puts "</table>\n" } \
100 # request standard tags
109 # foreach e [array names env] { ::puts stderr "$e\t$env($e)" }
110 # ::puts stderr [request serialize]
112 set script [lindex [request get -10] 0]
114 catch {set name [lindex [request get -11] 0]}
116 if [catch {request get 1}] { set sides 1 }
117 set name [string map {/ "" . ""} $name]
120 if ![file isfile $name.txt] { set name OverView }
125 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
126 <title>OpenIsis - <%=name%></title>
127 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
129 <body bgcolor="#FFFFFF"
130 marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
132 <table width="100%" cellpadding="0" cellspacing="0"
133 marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" border="0">
135 <%-- left: the index --%>
136 <td valign="top" width="160">
137 <table border="0" cellspacing="5" width="100%" cols="1">
140 <% mikidoc ".index" %>
142 <a href="<%=name%>?print=">print</a><br>
143 <a href="/doc/<%=$name.txt%>">plaintext</a>
148 <%-- middle: the content --%>
151 <table border="0" cellspacing="5" width="100%" cols="1">
153 <td valign="top" bgcolor="#000000"><font color="#FFFFFF"><b>
159 <% set right [mikidoc $name.txt] %>
167 <%-- right: notes --%>
169 <td valign="top" width="25%">
170 <table border="0" cellspacing="5" width="100%" cols="1">
172 <td valign="top" bgcolor="#000000"><font color="#FFFFFF"><b>
178 <% mikidoc $right.txt %>