Copy icons and docs.
[AROS-Contrib.git] / sqlite3 / common.tcl
blobcb2d04397f4840cc14573ddd8b904558deb3011d
1 # This file contains TCL procedures used to generate standard parts of
2 # web pages.
5 proc header {txt} {
6 puts "<html><head><title>$txt</title></head>"
7 puts \
8 {<body bgcolor="white" link="#50695f" vlink="#508896">
9 <table width="100%" border="0">
10 <tr><td valign="top"><img src="sqlite.gif"></td>
11 <td width="100%"></td>
12 <td valign="bottom">
13 <ul>
14 <li><a href="http://www.sqlite.org/cvstrac/tktnew">bugs</a></li>
15 <li><a href="changes.html">changes</a></li>
16 <li><a href="contrib">contrib</a></li>
17 <li><a href="download.html#cvs">cvs&nbsp;repository</a></li>
18 <li><a href="docs.html">documentation</a></li>
19 </ul>
20 </td>
21 <td width="10"></td>
22 <td valign="bottom">
23 <ul>
24 <li><a href="download.html">download</a></li>
25 <li><a href="faq.html">faq</a></li>
26 <li><a href="index.html">home</a></li>
27 <li><a href="support.html">mailing&nbsp;list</a></li>
28 <li><a href="index.html">news</a></li>
29 </ul>
30 </td>
31 <td width="10"></td>
32 <td valign="bottom">
33 <ul>
34 <li><a href="quickstart.html">quick&nbsp;start</a></li>
35 <li><a href="support.html">support</a></li>
36 <li><a href="lang.html">syntax</a></li>
37 <li><a href="http://www.sqlite.org/cvstrac/timeline">timeline</a></li>
38 <li><a href="http://www.sqlite.org/cvstrac/wiki">wiki</a></li>
39 </ul>
40 </td>
41 </tr></table>
42 <table width="100%">
43 <tr><td bgcolor="#80a796"></td></tr>
44 </table>}
47 proc footer {{rcsid {}}} {
48 puts {
49 <table width="100%">
50 <tr><td bgcolor="#80a796"></td></tr>
51 </table>}
52 set date [lrange $rcsid 3 4]
53 if {$date!=""} {
54 puts "<small><i>This page last modified on $date</i></small>"
56 puts {</body></html>}
60 # The following proc is used to ensure consistent formatting in the
61 # HTML generated by lang.tcl and pragma.tcl.
63 proc Syntax {args} {
64 puts {<table cellpadding="10">}
65 foreach {rule body} $args {
66 puts "<tr><td align=\"right\" valign=\"top\">"
67 puts "<i><font color=\"#ff3434\">$rule</font></i>&nbsp;::=</td>"
68 regsub -all < $body {%LT} body
69 regsub -all > $body {%GT} body
70 regsub -all %LT $body {</font></b><i><font color="#ff3434">} body
71 regsub -all %GT $body {</font></i><b><font color="#2c2cf0">} body
72 regsub -all {[]|[*?]} $body {</font></b>&<b><font color="#2c2cf0">} body
73 regsub -all "\n" [string trim $body] "<br>\n" body
74 regsub -all "\n *" $body "\n\\&nbsp;\\&nbsp;\\&nbsp;\\&nbsp;" body
75 regsub -all {[|,.*()]} $body {<big>&</big>} body
76 regsub -all { = } $body { <big>=</big> } body
77 regsub -all {STAR} $body {<big>*</big>} body
78 ## These metacharacters must be handled to undo being
79 ## treated as SQL punctuation characters above.
80 regsub -all {RPPLUS} $body {</font></b>)+<b><font color="#2c2cf0">} body
81 regsub -all {LP} $body {</font></b>(<b><font color="#2c2cf0">} body
82 regsub -all {RP} $body {</font></b>)<b><font color="#2c2cf0">} body
83 ## Place the left-hand side of the rule in the 2nd table column.
84 puts "<td><b><font color=\"#2c2cf0\">$body</font></b></td></tr>"
86 puts {</table>}