Documentation Source Text

Check-in [f280035157]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Experimental: Add pulldown menus to the toolbar. Combine code for generating the toolbar with the sitemap.html file.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f28003515701511bf85179572dc96b90b05f46b5
User & Date: dan 2007-12-10 10:01:15
Context
2007-12-11
06:58
Fix some problems with links in the experimental new toolbar. check-in: c9b14e2b54 user: dan tags: trunk
2007-12-10
10:01
Experimental: Add pulldown menus to the toolbar. Combine code for generating the toolbar with the sitemap.html file. check-in: f280035157 user: dan tags: trunk
06:18
Fix a typo in index.in: "This the homepage" -> "This is the homepage". check-in: 60f353c251 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/make
#
# Makefile for SQLite Documentation
#

#### The toplevel directory of the documentation source.
#
DOC = ../website/site

#### The toplevel directory of the program source code.
#
SRC = ../sqlite

#### Which "awk" program provides nawk compatibilty
#
# NAWK = nawk
NAWK = awk

# You should not have to change anything below this line
###############################################################################
include $(DOC)/main.mk







|













1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/make
#
# Makefile for SQLite Documentation
#

#### The toplevel directory of the documentation source.
#
DOC = ../website/

#### The toplevel directory of the program source code.
#
SRC = ../sqlite

#### Which "awk" program provides nawk compatibilty
#
# NAWK = nawk
NAWK = awk

# You should not have to change anything below this line
###############################################################################
include $(DOC)/main.mk

Added sitemap.tcl.























































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107


# The following data-structure is used to generate:
#
#     * The toolbar and pull-down menus, and
#     * The sitemap.html page.
#
set Sitemap {
  { "About" about.html {
       {"Feature List" features.html}
       {"Well-Known Users" famous.html}
       {"SQL Syntax" lang.html}
       {"C/C++ Interface" c3ref/intro.html}
       {"Developer Vitas" crew.html}
  }}
  { "Documentation" docs.html {
       {"Frequently Asked Questions" faq.html}
       {"SQLite In 5 Minutes Or Less" quickstart.html}
       {"C/C++ Interface Spec" c3ref/intro.html}
       {"SQL Syntax" lang.html}
       {"Appropriate Uses For SQLite" whentouse.html}
       {"Distinctive Features" different.html}
  }}
  { "License" copyright.html {
       {"Copyright Release Form" copyright-release.html}
       {"Purchase a License" http://www.hwaci.com/cgi-bin/license-step1}
  }}
  { "News" news.html {
       {"Older News" oldnews.html}
  }}
  { "Developers" http://www.sqlite.org/cvstrac/index.html {
       {"Timeline" http://www.sqlite.org/cvstrac/timeline}
       {"Wiki" http://www.sqlite.org/cvstrac/wiki}
       {"Report a Bug" http://www.sqlite.org/cvstrac/tktnew}
       {"Browse Bug Reports" http://www.sqlite.org/cvstrac/rptview?rn=5}
       {"Browse Source Code" http://www.sqlite.org/cvstrac/dir?d=sqlite}
       {"Website and Documentation Sources" http://www.sqlite.org/docsrc/home}
  }}
  { "Support" support.html {
     {"Mailing list archive" 
             http://www.mail-archive.com/sqlite-users%40sqlite.org {
         {"Alternate 1" http://marc.info/?l=sqlite-users&r=1&w=2}
         {"Alternate 2" http://news.gmane.org/gmane.comp.db.sqlite.general}
     }}
     {"Professional Support Options" 
             http://www.hwaci.com/sw/sqlite/prosupport.html {
         {"Annual Maintenance Subscription" 
              http://www.hwaci.com/sw/sqlite/ams.html}
         {"Technical Support Agreements"
              http://www.hwaci.com/sw/sqlite/tech.html}
         {"SQLite Consortium Membership"
              http://www.hwaci.com/sw/sqlite/member.html}
     }}
  }}
  { "Download" download.html }
}

proc create_sitemap_list {list} {
  set P ""
  foreach menuitem $list {
    unset -nocomplain menucontents
    foreach {caption uri menucontents} $menuitem break
    append P "<li><a href=\"$uri\">$caption</a>"
    if {[info exists menucontents]} {
      append P <ul>
      append P [create_sitemap_list $menucontents]
      append P </ul>
    }
  }
  return $P
}

proc create_sitemap {} {
  set P {
    <title>SQLite Site Map</title>
    <h2>Site Map</h2>
    <ul>
    <li><a href="index.html">Home Page</a>
  }

  append P [create_sitemap_list $::Sitemap]

  append P </ul>

  return $P
}

proc create_menubar {} {
  set sitemap [linsert $::Sitemap 0 [list Sitemap sitemap.html]]
  foreach menuitem $sitemap {
    set menucontents ""
    foreach {caption uri menucontents} $menuitem break

    putsin4 {<div class="menu"><div class="rel"><a href="${uri}">$caption</a>}
    if {$menucontents ne ""} {
      puts {<div class="pulldown">}
      foreach submenu $menucontents {
        foreach {caption uri} $submenu break
        putsin4 {<a href="${uri}">$caption</a>}
      }
      putsin4 {</div>}
    }
    putsin4 {</div></div>}
  }
}


Changes to wrap.tcl.

17
18
19
20
21
22
23



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
51
52
53
54
55
56
57

58
59
60
61
62
63
64
..
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

83


84
85
86
87
88
89
90
91
92
93
94
95































96
97







































98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122
123
124
125
126
...
160
161
162
163
164
165
166














167
168
169
170
171
172
173
174
175
176
177
178
179



180
181
182
183
184
185
186
187
188
#     *  Any <title>...</title> in the input is moved into the prepended
#        header.
#     *  An appropriate footer is appended.
#     *  Scripts within <tcl>...</tcl> are evaluated.  Output that
#        is emitted from these scripts by "puts" appears in place of
#        the original script.
#



set DOC [lindex $argv 0]
set SRC [lindex $argv 1]
set DEST [lindex $argv 2]
set HOMEDIR [pwd]            ;# Also remember our home directory.

# We are going to overload the puts command, so remember the
# original puts command using an alternative name.
rename puts real_puts
proc puts {text} {
  real_puts $::OUT $text
  flush $::OUT
}

# putsin4 is like puts except that it removes the first 4 indentation
# characters from each line.  It also does variable substitution in
# the namespace of its calling procedure.
#
proc putsin4 {text} {
  regsub -all "\n    " $text \n text
  real_puts $::OUT [uplevel 1 [list subst -noback -nocom $text]]
................................................................................
  puts {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">}
  puts {<html><head>}
  puts "<title>$title</title>"
  putsin4 {<style type="text/css">
    body {
        margin: auto;
        font-family: "Verdana" "sans-serif";

        padding: 8px 1%;
    }
    
    a { color: #45735f }
    a:visited { color: #734559 }
    
    .logo { position:absolute; margin:3px; }
................................................................................
      font-style:italic;
      width:240px;
      margin:12px;
      margin-top:58px;
    }
    
    .toolbar {
      font-variant: small-caps;
      text-align: center;
      line-height: 1.6em;
      margin: 0;
      padding:1px 8px;
    }
    .toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
    .toolbar a:visited { color: white; }

    .toolbar a:hover { color: #80a796; background: white; }


    
    .content    { margin: 5%; }
    .content dt { font-weight:bold; }
    .content dd { margin-bottom: 25px; margin-left:20%; }
    .content ul { padding:0px; padding-left: 15px; margin:0px; }
    
    /* rounded corners */
    .se  { background: url(${path}images/se.png) 100% 100% no-repeat #80a796}
    .sw  { background: url(${path}images/sw.png) 0% 100% no-repeat }
    .ne  { background: url(${path}images/ne.png) 100% 0% no-repeat }
    .nw  { background: url(${path}images/nw.png) 0% 0% no-repeat }
































    </style>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">







































  }
  puts {</head>}
  putsin4 {<body>
    <div><!-- container div to satisfy validator -->
    
    <a href="${path}index.html">
    <img class="logo" src="${path}images/SQLite.gif" alt="SQLite Logo"
     border="0"></a>
    <div><!-- IE hack to prevent disappearing logo--></div>
    <div class="tagline">Small, Fast, Reliable.<br>Choose any three.</div>
    
    <table width=100% style="clear:both"><tr><td>
      <div class="se"><div class="sw"><div class="ne"><div class="nw">
      <div class="toolbar">
        <a href="${path}about.html">About</a>
        <a href="${path}sitemap.html">Sitemap</a>

        <a href="${path}docs.html">Documentation</a>
        <a href="${path}download.html">Download</a>
        <a href="${path}copyright.html">License</a>
        <a href="${path}news.html">News</a>
        <a href="http://www.sqlite.org/cvstrac/index">Developers</a>
        <a href="${path}support.html">Support</a>
      </div></div></div></div></div>
    </td></tr></table>
  }
}

# A procedure to write the common footer found at the bottom of
# every HTML file.  $srcfile is the name of the file that is the
................................................................................
    regsub -all {LP} $body {</font></b>(<b><font color="#2c2cf0">} body
    regsub -all {RP} $body {</font></b>)<b><font color="#2c2cf0">} body
    ## Place the left-hand side of the rule in the 2nd table column.
    puts "<td><b><font color=\"#2c2cf0\">$body</font></b></td></tr>"
  }
  puts {</table>}
}















# Loop over all input files and process them one by one
#
foreach infile [lrange $argv 3 end] {
  cd $HOMEDIR
  real_puts "Processing $infile"
  set fd [open $infile r]
  set in [read $fd]
  close $fd
  set title {No Title}
  regexp {<title>([^\n]*)</title>} $in all title
  regsub {<title>[^\n]*</title>} $in {} in
  set outfile [file root [file tail $infile]].html



  set ::OUT [open $::DEST/$outfile w]
  PutsHeader $title
  regsub -all {<tcl>} $in "\175; eval \173" in
  regsub -all {</tcl>} $in "\175; puts \173" in
  eval "puts \173$in\175"
  cd $::HOMEDIR
  PutsFooter $infile
  close $::OUT
}







>
>
>












<







 







>







 







<





|

>
|
>
>












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










<



|
<
>
|
|
|
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>









<
<
<

>
>
>
|
<
<
<
<
<
<
<
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
..
71
72
73
74
75
76
77

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182

183
184
185
186

187
188
189
190



191
192
193
194
195
196
197
...
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260



261
262
263
264
265







266
#     *  Any <title>...</title> in the input is moved into the prepended
#        header.
#     *  An appropriate footer is appended.
#     *  Scripts within <tcl>...</tcl> are evaluated.  Output that
#        is emitted from these scripts by "puts" appears in place of
#        the original script.
#

source [file join [file dirname [info script]] sitemap.tcl]

set DOC [lindex $argv 0]
set SRC [lindex $argv 1]
set DEST [lindex $argv 2]
set HOMEDIR [pwd]            ;# Also remember our home directory.

# We are going to overload the puts command, so remember the
# original puts command using an alternative name.
rename puts real_puts
proc puts {text} {
  real_puts $::OUT $text
  flush $::OUT
}

# putsin4 is like puts except that it removes the first 4 indentation
# characters from each line.  It also does variable substitution in
# the namespace of its calling procedure.
#
proc putsin4 {text} {
  regsub -all "\n    " $text \n text
  real_puts $::OUT [uplevel 1 [list subst -noback -nocom $text]]
................................................................................
  puts {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">}
  puts {<html><head>}
  puts "<title>$title</title>"
  putsin4 {<style type="text/css">
    body {
        margin: auto;
        font-family: "Verdana" "sans-serif";
        line-height: 1.5em;
        padding: 8px 1%;
    }
    
    a { color: #45735f }
    a:visited { color: #734559 }
    
    .logo { position:absolute; margin:3px; }
................................................................................
      font-style:italic;
      width:240px;
      margin:12px;
      margin-top:58px;
    }
    
    .toolbar {

      text-align: center;
      line-height: 1.6em;
      margin: 0;
      padding:1px 8px;
    }
    .toolbar a { color: white; text-decoration: none; padding: 2px 12px 6px; }
    .toolbar a:visited { color: white; }
    .toolbar a:hover { 
       color: #80a796; background: white; text-decoration: underline
    }
    .toolbar a:active { color: blue }
    
    .content    { margin: 5%; }
    .content dt { font-weight:bold; }
    .content dd { margin-bottom: 25px; margin-left:20%; }
    .content ul { padding:0px; padding-left: 15px; margin:0px; }
    
    /* rounded corners */
    .se  { background: url(${path}images/se.png) 100% 100% no-repeat #80a796}
    .sw  { background: url(${path}images/sw.png) 0% 100% no-repeat }
    .ne  { background: url(${path}images/ne.png) 100% 0% no-repeat }
    .nw  { background: url(${path}images/nw.png) 0% 0% no-repeat }

    /* CSS for drop down menus */
    .menu {
      float:left;
    }
    .pulldown {
      font-size: 0.8em;
      line-height: 1.0;
      left:0px;
      top:100%;
      margin-top:0px;
      display: none;
      position: absolute;
      z-index: 1;
      border: 2px solid #80a796;
      background: #80a796;
      text-align: left;

      border-left-color: #607d71;
      border-right-color: #607d71;
      border-bottom-color: #607d71;
    }

    .pulldown a { display: block; white-space: nowrap; }
    .toolbar table, .toolbar tbody, .toolbar tr, .toolbar td { 
      padding: 0; border-spacing: 0
    }
    .rel {position: relative}

    .over .pulldown, .menu:hover .pulldown { display: block; }
    .over .pulldown, .menu:hover .pulldown { display: block; }

    </style>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <script type="text/javascript">

      var current_menu_id = null
      var current_timeout = null

      function menu_mouseover () {
        menu_mouseout_delayed()
        this.className += " over"
        current_menu_id = this.id
      }
      function menu_mouseout () {
        current_timeout = window.setTimeout('menu_mouseout_delayed()', 500)
      }
      function menu_mouseout_delayed (id) {
        var elem = document.getElementById(current_menu_id)
        if (elem) {
          elem.className = elem.className.replace(" over", "")
        }
        if (current_timeout) {
          window.clearTimeout(current_timeout)
        }
        current_menu_id = null
        current_timeout = null
      }

      window.onload = function() {
        var collection = document.getElementsByTagName("div")
        var ii
        for (ii = 0; ii < collection.length; ii++) {
          var span = collection.item(ii)
          if (span.className == "menu") {
            span.onmouseover = menu_mouseover
            span.onmouseout  = menu_mouseout
            span.id  = "menu" + ii
          }
        }
      }
    </script>
  }
  puts {</head>}
  putsin4 {<body>
    <div><!-- container div to satisfy validator -->
    
    <a href="${path}index.html">
    <img class="logo" src="${path}images/SQLite.gif" alt="SQLite Logo"
     border="0"></a>
    <div><!-- IE hack to prevent disappearing logo--></div>
    <div class="tagline">Small, Fast, Reliable.<br>Choose any three.</div>

    <table width=100% style="clear:both"><tr><td>
      <div class="se"><div class="sw"><div class="ne"><div class="nw">
      <div class="toolbar">
        <table style="margin:auto"><tr><td>

  }
  create_menubar
  putsin4 {
        </tr></table>



      </div></div></div></div></div>
    </td></tr></table>
  }
}

# A procedure to write the common footer found at the bottom of
# every HTML file.  $srcfile is the name of the file that is the
................................................................................
    regsub -all {LP} $body {</font></b>(<b><font color="#2c2cf0">} body
    regsub -all {RP} $body {</font></b>)<b><font color="#2c2cf0">} body
    ## Place the left-hand side of the rule in the 2nd table column.
    puts "<td><b><font color=\"#2c2cf0\">$body</font></b></td></tr>"
  }
  puts {</table>}
}

proc process_infile {in infile outfile} {
  set title {No Title}
  regexp {<title>([^\n]*)</title>} $in all title
  regsub {<title>[^\n]*</title>} $in {} in
  set ::OUT [open $::DEST/$outfile w]
  PutsHeader $title
  regsub -all {<tcl>} $in "\175; eval \173" in
  regsub -all {</tcl>} $in "\175; puts \173" in
  uplevel #0 "puts \173$in\175"
  cd $::HOMEDIR
  PutsFooter $infile
  close $::OUT
}

# Loop over all input files and process them one by one
#
foreach infile [lrange $argv 3 end] {
  cd $HOMEDIR
  real_puts "Processing $infile"
  set fd [open $infile r]
  set in [read $fd]
  close $fd



  set outfile [file root [file tail $infile]].html
  process_infile $in $infile $outfile
}

process_infile [create_sitemap] [info script] sitemap.html