/ Check-in [485c52dd]
Login

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

Overview
Comment:Add a few "class" attributes to the html generated by lang.tcl to support conversion to pdf. (CVS 3677)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:485c52ddc0f3c24f624825904cea3566f83f0e68
User & Date: danielk1977 2007-03-09 14:40:59
Context
2007-03-09
14:43
Remove extra heading accidentally added to lang.tcl by (3677). (CVS 3678) check-in: 570533c1 user: danielk1977 tags: trunk
14:40
Add a few "class" attributes to the html generated by lang.tcl to support conversion to pdf. (CVS 3677) check-in: 485c52dd user: danielk1977 tags: trunk
2007-03-08
12:23
Change the documentation to be more specific about the restriction on the use of keywords. Ticket #2264. (CVS 3676) check-in: d03d4805 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to www/common.tcl.

     1      1   # This file contains TCL procedures used to generate standard parts of
     2      2   # web pages.
     3      3   #
     4      4   
     5      5   proc header {txt} {
     6      6     puts "<html><head><title>$txt</title></head>"
            7  +  puts {<DIV class="pdf_ignore">}
     7      8     puts \
     8      9   {<body bgcolor="white" link="#50695f" vlink="#508896">
     9     10   <table width="100%" border="0">
    10     11   <tr><td valign="top">
    11     12   <a href="index.html"><img src="sqlite.gif" border="none"></a></td>
    12     13   <td width="100%"></td>
    13     14   <td valign="bottom">
................................................................................
    39     40   <li><a href="http://www.sqlite.org/cvstrac/wiki">wiki</a></li>
    40     41   </ul>
    41     42   </td>
    42     43   </tr></table>
    43     44   <table width="100%">
    44     45   <tr><td bgcolor="#80a796"></td></tr>
    45     46   </table>}
           47  +  puts </DIV>
    46     48   }
    47     49   
    48     50   proc footer {{rcsid {}}} {
    49     51     puts {
    50     52   <table width="100%">
    51     53   <tr><td bgcolor="#80a796"></td></tr>
    52     54   </table>}
................................................................................
    58     60   }
    59     61   
    60     62   
    61     63   # The following proc is used to ensure consistent formatting in the 
    62     64   # HTML generated by lang.tcl and pragma.tcl.
    63     65   #
    64     66   proc Syntax {args} {
    65         -  puts {<table cellpadding="10">}
           67  +  puts {<table cellpadding="10" class=pdf_syntax>}
    66     68     foreach {rule body} $args {
    67     69       puts "<tr><td align=\"right\" valign=\"top\">"
    68     70       puts "<i><font color=\"#ff3434\">$rule</font></i>&nbsp;::=</td>"
    69     71       regsub -all < $body {%LT} body
    70     72       regsub -all > $body {%GT} body
    71     73       regsub -all %LT $body {</font></b><i><font color="#ff3434">} body
    72     74       regsub -all %GT $body {</font></i><b><font color="#2c2cf0">} body

Changes to www/lang.tcl.

     1      1   #
     2      2   # Run this Tcl script to generate the lang-*.html files.
     3      3   #
     4         -set rcsid {$Id: lang.tcl,v 1.123 2007/03/08 12:23:34 drh Exp $}
            4  +set rcsid {$Id: lang.tcl,v 1.124 2007/03/09 14:40:59 danielk1977 Exp $}
     5      5   source common.tcl
     6      6   
     7      7   if {[llength $argv]>0} {
     8      8     set outputdir [lindex $argv 0]
     9      9   } else {
    10     10     set outputdir ""
    11     11   }
    12     12   
    13     13   header {Query Language Understood by SQLite}
    14     14   puts {
    15         -<h1>SQL As Understood By SQLite</h1>
           15  +<h1 class="pdf_section">SQL As Understood By SQLite</h1>
    16     16   
    17     17   <p>The SQLite library understands most of the standard SQL
    18     18   language.  But it does <a href="omitted.html">omit some features</a>
    19     19   while at the same time
    20     20   adding a few features of its own.  This document attempts to
    21     21   describe precisely what parts of the SQL language SQLite does
    22     22   and does not support.  A list of <a href="lang_keywords.html">keywords</a> is 
................................................................................
    27     27   that are part of the syntactic markup itself are shown in black roman.</p>
    28     28   
    29     29   <p>This document is just an overview of the SQL syntax implemented
    30     30   by SQLite.  Many low-level productions are omitted.  For detailed information
    31     31   on the language that SQLite understands, refer to the source code and
    32     32   the grammar file "parse.y".</p>
    33     33   
    34         -
           34  +<div class="pdf_ignore">
    35     35   <p>SQLite implements the follow syntax:</p>
    36     36   <p><ul>
    37     37   }
    38     38   
    39     39   proc slink {label} {
    40     40     if {[string match *.html $label]} {
    41     41       return $label
................................................................................
    79     79     {{ALTER TABLE} altertable}
    80     80     {{ANALYZE} analyze}
    81     81   }] {
    82     82     foreach {s_title s_tag} $section {}
    83     83     puts "<li><a href=\"[slink $s_tag]\">$s_title</a></li>"
    84     84   }
    85     85   puts {</ul></p>
           86  +</div>
    86     87   
    87     88   <p>Details on the implementation of each command are provided in
    88     89   the sequel.</p>
           90  +
           91  +<h1 class="pdf_section">SQLite Commands</h1>
    89     92   }
    90     93   
    91     94   proc Operator {name} {
    92     95     return "<font color=\"#2c2cf0\"><big>$name</big></font>"
    93     96   }
    94     97   proc Nonterminal {name} {
    95     98     return "<i><font color=\"#ff3434\">$name</font></i>"
................................................................................
    99    102   }
   100    103   proc Example {text} {
   101    104     puts "<blockquote><pre>$text</pre></blockquote>"
   102    105   }
   103    106   
   104    107   proc Section {name label} {
   105    108     global outputdir
          109  +
   106    110   
   107    111     if {[string length $outputdir]!=0} {
   108    112       if {[llength [info commands puts_standard]]>0} {
   109    113         footer $::rcsid
   110    114       }
   111    115   
   112    116       if {[string length $label]>0} {
................................................................................
  1090   1094   A parameter specifies a placeholder in the expression for a literal
  1091   1095   value that is filled in at runtime using the
  1092   1096   <a href="capi3ref.html#sqlite3_bind_int">sqlite3_bind</a> API.
  1093   1097   Parameters can take several forms:
  1094   1098   </p
  1095   1099   
  1096   1100   <blockquote>
  1097         -<table>
         1101  +<table class="pdf_functions">
  1098   1102   <tr>
  1099   1103   <td align="right" valign="top"><b>?</b><i>NNN</i></td><td width="20"></td>
  1100   1104   <td>A question mark followed by a number <i>NNN</i> holds a spot for the
  1101   1105   NNN-th parameter.  NNN must be between 1 and 999.</td>
  1102   1106   </tr>
  1103   1107   <tr>
  1104   1108   <td align="right" valign="top"><b>?</b></td><td width="20"></td>
................................................................................
  1253   1257   <b>Core Functions</b>
  1254   1258   
  1255   1259   <p>The core functions shown below are available by default.  Additional
  1256   1260   functions may be written in C and added to the database engine using
  1257   1261   the <a href="capi3ref.html#cfunc">sqlite3_create_function()</a>
  1258   1262   API.</p>
  1259   1263   
  1260         -<table border=0 cellpadding=10>
         1264  +<table border=0 cellpadding=10 class="pdf_functions">
  1261   1265   <tr>
  1262   1266   <td valign="top" align="right" width=120>abs(<i>X</i>)</td>
  1263   1267   <td valign="top">Return the absolute value of argument <i>X</i>.</td>
  1264   1268   </tr>
  1265   1269   
  1266   1270   <tr>
  1267   1271   <td valign="top" align="right">coalesce(<i>X</i>,<i>Y</i>,...)</td>
................................................................................
  1466   1470   can be preceeded by the keyword DISTINCT.  In such cases, duplicate
  1467   1471   elements are filtered before being passed into the aggregate function.
  1468   1472   For example, the function "count(distinct X)" will return the number
  1469   1473   of distinct values of column X instead of the total number of non-null
  1470   1474   values in column X.
  1471   1475   </p>
  1472   1476   
  1473         -<table border=0 cellpadding=10>
         1477  +<table border=0 cellpadding=10 class="pdf_functions">
  1474   1478   <tr>
  1475   1479   <td valign="top" align="right" width=120>avg(<i>X</i>)</td>
  1476   1480   <td valign="top">Return the average value of all non-NULL <i>X</i> within a
  1477   1481   group.  String and BLOB values that do not look like numbers are
  1478   1482   interpreted as 0.
  1479   1483   The result of avg() is always a floating point value even if all
  1480   1484   inputs are integers. </p></td>
................................................................................
  1978   1982      VIRTUAL*
  1979   1983      WHEN
  1980   1984      WHERE
  1981   1985   }]
  1982   1986   
  1983   1987   
  1984   1988   
  1985         -Section {SQLite keywords} keywords
         1989  +puts {<DIV class="pdf_section">}
         1990  +Section {SQLite Keywords} keywords 
         1991  +puts {</DIV>}
  1986   1992   
  1987   1993   puts {
  1988   1994   <p>The SQL standard specifies a huge number of keywords which may not
  1989   1995   be used as the names of tables, indices, columns, databases, user-defined
  1990   1996   functions, collations, virtual table modules, or any other named object.
  1991   1997   The list of keywords is so long that few people can remember them all.
  1992   1998   For most SQL code, your safest bet is to never use any English language
................................................................................
  1993   1999   word as the name of a user-defined object.</p>
  1994   2000   
  1995   2001   <p>If you want to use a keyword as a name, you need to quote it.  There
  1996   2002   are three ways of quoting keywords in SQLite:</p>
  1997   2003   
  1998   2004   <p>
  1999   2005   <blockquote>
  2000         -<table>
         2006  +<table class="pdf_functions">
  2001   2007   <tr>	<td valign="top"><b>'keyword'</b></td><td width="20"></td>
  2002   2008   	<td>A keyword in single quotes is interpreted as a literal string
  2003   2009           if it occurs in a context where a string literal is allowed, otherwise
  2004   2010   	it is understood as an identifier.</td></tr>
  2005   2011   <tr>	<td valign="top"><b>"keyword"</b></td><td></td>
  2006   2012   	<td>A keyword in double-quotes is interpreted as an identifier if
  2007   2013           it matches a known identifier.  Otherwise it is interpreted as a
................................................................................
  2032   2038   </p>
  2033   2039   
  2034   2040   <p>
  2035   2041   The following are the keywords currently recognized by SQLite:
  2036   2042   </p>
  2037   2043   
  2038   2044   <blockquote>
  2039         -<table width="100%">
         2045  +<table width="100%" class="pdf_keywords">
  2040   2046   <tr>
  2041   2047   <td align="left" valign="top" width="20%">
  2042   2048   }
  2043   2049   
  2044   2050   set n [llength $keyword_list]
  2045   2051   set nCol 5
  2046   2052   set nRow [expr {($n+$nCol-1)/$nCol}]
................................................................................
  2066   2072   
  2067   2073   <h2>Special names</h2>
  2068   2074   
  2069   2075   <p>The following are not keywords in SQLite, but are used as names of 
  2070   2076   system objects.  They can be used as an identifier for a different 
  2071   2077   type of object.</p>
  2072   2078   
  2073         -<blockquote><b>
         2079  +<blockquote class="pdf_keywords"><b>
  2074   2080     _ROWID_<br>
  2075   2081     MAIN<br>
  2076   2082     OID<br>
  2077   2083     ROWID<br>
  2078   2084     SQLITE_MASTER<br>
  2079   2085     SQLITE_SEQUENCE<br>
  2080   2086     SQLITE_TEMP_MASTER<br>
  2081   2087     TEMP<br>
  2082   2088   </b></blockquote>
  2083   2089   }
  2084   2090   
         2091  +puts {<DIV class="pdf_ignore">}
  2085   2092   footer $rcsid
  2086   2093   if {[string length $outputdir]} {
  2087   2094     footer $rcsid
  2088   2095   }
         2096  +puts {</DIV>}