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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.

     1      1   #!/usr/make
     2      2   #
     3      3   # Makefile for SQLite Documentation
     4      4   #
     5      5   
     6      6   #### The toplevel directory of the documentation source.
     7      7   #
     8         -DOC = ../website/site
            8  +DOC = ../website/
     9      9   
    10     10   #### The toplevel directory of the program source code.
    11     11   #
    12     12   SRC = ../sqlite
    13     13   
    14     14   #### Which "awk" program provides nawk compatibilty
    15     15   #
    16     16   # NAWK = nawk
    17     17   NAWK = awk
    18     18   
    19     19   # You should not have to change anything below this line
    20     20   ###############################################################################
    21     21   include $(DOC)/main.mk

Added sitemap.tcl.

            1  +
            2  +
            3  +# The following data-structure is used to generate:
            4  +#
            5  +#     * The toolbar and pull-down menus, and
            6  +#     * The sitemap.html page.
            7  +#
            8  +set Sitemap {
            9  +  { "About" about.html {
           10  +       {"Feature List" features.html}
           11  +       {"Well-Known Users" famous.html}
           12  +       {"SQL Syntax" lang.html}
           13  +       {"C/C++ Interface" c3ref/intro.html}
           14  +       {"Developer Vitas" crew.html}
           15  +  }}
           16  +  { "Documentation" docs.html {
           17  +       {"Frequently Asked Questions" faq.html}
           18  +       {"SQLite In 5 Minutes Or Less" quickstart.html}
           19  +       {"C/C++ Interface Spec" c3ref/intro.html}
           20  +       {"SQL Syntax" lang.html}
           21  +       {"Appropriate Uses For SQLite" whentouse.html}
           22  +       {"Distinctive Features" different.html}
           23  +  }}
           24  +  { "License" copyright.html {
           25  +       {"Copyright Release Form" copyright-release.html}
           26  +       {"Purchase a License" http://www.hwaci.com/cgi-bin/license-step1}
           27  +  }}
           28  +  { "News" news.html {
           29  +       {"Older News" oldnews.html}
           30  +  }}
           31  +  { "Developers" http://www.sqlite.org/cvstrac/index.html {
           32  +       {"Timeline" http://www.sqlite.org/cvstrac/timeline}
           33  +       {"Wiki" http://www.sqlite.org/cvstrac/wiki}
           34  +       {"Report a Bug" http://www.sqlite.org/cvstrac/tktnew}
           35  +       {"Browse Bug Reports" http://www.sqlite.org/cvstrac/rptview?rn=5}
           36  +       {"Browse Source Code" http://www.sqlite.org/cvstrac/dir?d=sqlite}
           37  +       {"Website and Documentation Sources" http://www.sqlite.org/docsrc/home}
           38  +  }}
           39  +  { "Support" support.html {
           40  +     {"Mailing list archive" 
           41  +             http://www.mail-archive.com/sqlite-users%40sqlite.org {
           42  +         {"Alternate 1" http://marc.info/?l=sqlite-users&r=1&w=2}
           43  +         {"Alternate 2" http://news.gmane.org/gmane.comp.db.sqlite.general}
           44  +     }}
           45  +     {"Professional Support Options" 
           46  +             http://www.hwaci.com/sw/sqlite/prosupport.html {
           47  +         {"Annual Maintenance Subscription" 
           48  +              http://www.hwaci.com/sw/sqlite/ams.html}
           49  +         {"Technical Support Agreements"
           50  +              http://www.hwaci.com/sw/sqlite/tech.html}
           51  +         {"SQLite Consortium Membership"
           52  +              http://www.hwaci.com/sw/sqlite/member.html}
           53  +     }}
           54  +  }}
           55  +  { "Download" download.html }
           56  +}
           57  +
           58  +proc create_sitemap_list {list} {
           59  +  set P ""
           60  +  foreach menuitem $list {
           61  +    unset -nocomplain menucontents
           62  +    foreach {caption uri menucontents} $menuitem break
           63  +    append P "<li><a href=\"$uri\">$caption</a>"
           64  +    if {[info exists menucontents]} {
           65  +      append P <ul>
           66  +      append P [create_sitemap_list $menucontents]
           67  +      append P </ul>
           68  +    }
           69  +  }
           70  +  return $P
           71  +}
           72  +
           73  +proc create_sitemap {} {
           74  +  set P {
           75  +    <title>SQLite Site Map</title>
           76  +    <h2>Site Map</h2>
           77  +    <ul>
           78  +    <li><a href="index.html">Home Page</a>
           79  +  }
           80  +
           81  +  append P [create_sitemap_list $::Sitemap]
           82  +
           83  +  append P </ul>
           84  +
           85  +  return $P
           86  +}
           87  +
           88  +proc create_menubar {} {
           89  +  set sitemap [linsert $::Sitemap 0 [list Sitemap sitemap.html]]
           90  +  foreach menuitem $sitemap {
           91  +    set menucontents ""
           92  +    foreach {caption uri menucontents} $menuitem break
           93  +
           94  +    putsin4 {<div class="menu"><div class="rel"><a href="${uri}">$caption</a>}
           95  +    if {$menucontents ne ""} {
           96  +      puts {<div class="pulldown">}
           97  +      foreach submenu $menucontents {
           98  +        foreach {caption uri} $submenu break
           99  +        putsin4 {<a href="${uri}">$caption</a>}
          100  +      }
          101  +      putsin4 {</div>}
          102  +    }
          103  +    putsin4 {</div></div>}
          104  +  }
          105  +}
          106  +
          107  +

Changes to wrap.tcl.

    17     17   #     *  Any <title>...</title> in the input is moved into the prepended
    18     18   #        header.
    19     19   #     *  An appropriate footer is appended.
    20     20   #     *  Scripts within <tcl>...</tcl> are evaluated.  Output that
    21     21   #        is emitted from these scripts by "puts" appears in place of
    22     22   #        the original script.
    23     23   #
           24  +
           25  +source [file join [file dirname [info script]] sitemap.tcl]
           26  +
    24     27   set DOC [lindex $argv 0]
    25     28   set SRC [lindex $argv 1]
    26     29   set DEST [lindex $argv 2]
    27     30   set HOMEDIR [pwd]            ;# Also remember our home directory.
    28     31   
    29     32   # We are going to overload the puts command, so remember the
    30     33   # original puts command using an alternative name.
    31     34   rename puts real_puts
    32     35   proc puts {text} {
    33     36     real_puts $::OUT $text
    34     37     flush $::OUT
    35     38   }
    36         -
    37     39   # putsin4 is like puts except that it removes the first 4 indentation
    38     40   # characters from each line.  It also does variable substitution in
    39     41   # the namespace of its calling procedure.
    40     42   #
    41     43   proc putsin4 {text} {
    42     44     regsub -all "\n    " $text \n text
    43     45     real_puts $::OUT [uplevel 1 [list subst -noback -nocom $text]]
................................................................................
    51     53     puts {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">}
    52     54     puts {<html><head>}
    53     55     puts "<title>$title</title>"
    54     56     putsin4 {<style type="text/css">
    55     57       body {
    56     58           margin: auto;
    57     59           font-family: "Verdana" "sans-serif";
           60  +        line-height: 1.5em;
    58     61           padding: 8px 1%;
    59     62       }
    60     63       
    61     64       a { color: #45735f }
    62     65       a:visited { color: #734559 }
    63     66       
    64     67       .logo { position:absolute; margin:3px; }
................................................................................
    68     71         font-style:italic;
    69     72         width:240px;
    70     73         margin:12px;
    71     74         margin-top:58px;
    72     75       }
    73     76       
    74     77       .toolbar {
    75         -      font-variant: small-caps;
    76     78         text-align: center;
    77     79         line-height: 1.6em;
    78     80         margin: 0;
    79     81         padding:1px 8px;
    80     82       }
    81         -    .toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           83  +    .toolbar a { color: white; text-decoration: none; padding: 2px 12px 6px; }
    82     84       .toolbar a:visited { color: white; }
    83         -    .toolbar a:hover { color: #80a796; background: white; }
           85  +    .toolbar a:hover { 
           86  +       color: #80a796; background: white; text-decoration: underline
           87  +    }
           88  +    .toolbar a:active { color: blue }
    84     89       
    85     90       .content    { margin: 5%; }
    86     91       .content dt { font-weight:bold; }
    87     92       .content dd { margin-bottom: 25px; margin-left:20%; }
    88     93       .content ul { padding:0px; padding-left: 15px; margin:0px; }
    89     94       
    90     95       /* rounded corners */
    91     96       .se  { background: url(${path}images/se.png) 100% 100% no-repeat #80a796}
    92     97       .sw  { background: url(${path}images/sw.png) 0% 100% no-repeat }
    93     98       .ne  { background: url(${path}images/ne.png) 100% 0% no-repeat }
    94     99       .nw  { background: url(${path}images/nw.png) 0% 0% no-repeat }
    95    100   
          101  +    /* CSS for drop down menus */
          102  +    .menu {
          103  +      float:left;
          104  +    }
          105  +    .pulldown {
          106  +      font-size: 0.8em;
          107  +      line-height: 1.0;
          108  +      left:0px;
          109  +      top:100%;
          110  +      margin-top:0px;
          111  +      display: none;
          112  +      position: absolute;
          113  +      z-index: 1;
          114  +      border: 2px solid #80a796;
          115  +      background: #80a796;
          116  +      text-align: left;
          117  +
          118  +      border-left-color: #607d71;
          119  +      border-right-color: #607d71;
          120  +      border-bottom-color: #607d71;
          121  +    }
          122  +
          123  +    .pulldown a { display: block; white-space: nowrap; }
          124  +    .toolbar table, .toolbar tbody, .toolbar tr, .toolbar td { 
          125  +      padding: 0; border-spacing: 0
          126  +    }
          127  +    .rel {position: relative}
          128  +
          129  +    .over .pulldown, .menu:hover .pulldown { display: block; }
          130  +    .over .pulldown, .menu:hover .pulldown { display: block; }
          131  +
    96    132       </style>
    97    133       <meta http-equiv="content-type" content="text/html; charset=UTF-8">
          134  +
          135  +    <script type="text/javascript">
          136  +
          137  +      var current_menu_id = null
          138  +      var current_timeout = null
          139  +
          140  +      function menu_mouseover () {
          141  +        menu_mouseout_delayed()
          142  +        this.className += " over"
          143  +        current_menu_id = this.id
          144  +      }
          145  +      function menu_mouseout () {
          146  +        current_timeout = window.setTimeout('menu_mouseout_delayed()', 500)
          147  +      }
          148  +      function menu_mouseout_delayed (id) {
          149  +        var elem = document.getElementById(current_menu_id)
          150  +        if (elem) {
          151  +          elem.className = elem.className.replace(" over", "")
          152  +        }
          153  +        if (current_timeout) {
          154  +          window.clearTimeout(current_timeout)
          155  +        }
          156  +        current_menu_id = null
          157  +        current_timeout = null
          158  +      }
          159  +
          160  +      window.onload = function() {
          161  +        var collection = document.getElementsByTagName("div")
          162  +        var ii
          163  +        for (ii = 0; ii < collection.length; ii++) {
          164  +          var span = collection.item(ii)
          165  +          if (span.className == "menu") {
          166  +            span.onmouseover = menu_mouseover
          167  +            span.onmouseout  = menu_mouseout
          168  +            span.id  = "menu" + ii
          169  +          }
          170  +        }
          171  +      }
          172  +    </script>
    98    173     }
    99    174     puts {</head>}
   100    175     putsin4 {<body>
   101    176       <div><!-- container div to satisfy validator -->
   102    177       
   103    178       <a href="${path}index.html">
   104    179       <img class="logo" src="${path}images/SQLite.gif" alt="SQLite Logo"
   105    180        border="0"></a>
   106    181       <div><!-- IE hack to prevent disappearing logo--></div>
   107    182       <div class="tagline">Small, Fast, Reliable.<br>Choose any three.</div>
   108         -    
   109    183       <table width=100% style="clear:both"><tr><td>
   110    184         <div class="se"><div class="sw"><div class="ne"><div class="nw">
   111    185         <div class="toolbar">
   112         -        <a href="${path}about.html">About</a>
   113         -        <a href="${path}sitemap.html">Sitemap</a>
   114         -        <a href="${path}docs.html">Documentation</a>
   115         -        <a href="${path}download.html">Download</a>
   116         -        <a href="${path}copyright.html">License</a>
   117         -        <a href="${path}news.html">News</a>
   118         -        <a href="http://www.sqlite.org/cvstrac/index">Developers</a>
   119         -        <a href="${path}support.html">Support</a>
          186  +        <table style="margin:auto"><tr><td>
          187  +  }
          188  +  create_menubar
          189  +  putsin4 {
          190  +        </tr></table>
   120    191         </div></div></div></div></div>
   121    192       </td></tr></table>
   122    193     }
   123    194   }
   124    195   
   125    196   # A procedure to write the common footer found at the bottom of
   126    197   # every HTML file.  $srcfile is the name of the file that is the
................................................................................
   160    231       regsub -all {LP} $body {</font></b>(<b><font color="#2c2cf0">} body
   161    232       regsub -all {RP} $body {</font></b>)<b><font color="#2c2cf0">} body
   162    233       ## Place the left-hand side of the rule in the 2nd table column.
   163    234       puts "<td><b><font color=\"#2c2cf0\">$body</font></b></td></tr>"
   164    235     }
   165    236     puts {</table>}
   166    237   }
          238  +
          239  +proc process_infile {in infile outfile} {
          240  +  set title {No Title}
          241  +  regexp {<title>([^\n]*)</title>} $in all title
          242  +  regsub {<title>[^\n]*</title>} $in {} in
          243  +  set ::OUT [open $::DEST/$outfile w]
          244  +  PutsHeader $title
          245  +  regsub -all {<tcl>} $in "\175; eval \173" in
          246  +  regsub -all {</tcl>} $in "\175; puts \173" in
          247  +  uplevel #0 "puts \173$in\175"
          248  +  cd $::HOMEDIR
          249  +  PutsFooter $infile
          250  +  close $::OUT
          251  +}
   167    252   
   168    253   # Loop over all input files and process them one by one
   169    254   #
   170    255   foreach infile [lrange $argv 3 end] {
   171    256     cd $HOMEDIR
   172    257     real_puts "Processing $infile"
   173    258     set fd [open $infile r]
   174    259     set in [read $fd]
   175    260     close $fd
   176         -  set title {No Title}
   177         -  regexp {<title>([^\n]*)</title>} $in all title
   178         -  regsub {<title>[^\n]*</title>} $in {} in
   179    261     set outfile [file root [file tail $infile]].html
   180         -  set ::OUT [open $::DEST/$outfile w]
   181         -  PutsHeader $title
   182         -  regsub -all {<tcl>} $in "\175; eval \173" in
   183         -  regsub -all {</tcl>} $in "\175; puts \173" in
   184         -  eval "puts \173$in\175"
   185         -  cd $::HOMEDIR
   186         -  PutsFooter $infile
   187         -  close $::OUT
          262  +  process_infile $in $infile $outfile
   188    263   }
          264  +
          265  +process_infile [create_sitemap] [info script] sitemap.html
          266  +