Documentation Source Text

Check-in [5f5f7776fc]
Login

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

Overview
Comment:Generate the "toc.db" database containing all interfaces with links to their documentation.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5f5f7776fcf7162a30e2c1317b13413fd6c8f216
User & Date: drh 2015-04-10 14:08:25
Context
2015-04-10
14:39
Add a brief comment describing what the toc.db build logic is used for and why it is important. check-in: c7671e4258 user: drh tags: trunk
14:08
Generate the "toc.db" database containing all interfaces with links to their documentation. check-in: 5f5f7776fc user: drh tags: trunk
2015-04-08
14:12
Add the checksum and source-ids for version 3.8.9 to the changelog. Update the release date to the 8th. check-in: bed24cae9a user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to pages/capi3ref.in.

   360    360   be removed in some future release.</li>
   361    361   </ul>
   362    362   
   363    363   <tcl>
   364    364   hd_close_aux
   365    365   hd_puts {<hr>}
   366    366   
          367  +sqlite3 dbtoc doc/toc.db
          368  +dbtoc eval {
          369  +BEGIN;
          370  +DROP TABLE IF EXISTS toc;
          371  +CREATE TABLE toc(
          372  +  name TEXT,  -- Name of interface
          373  +  type TEXT,  -- 'object', 'constant', or 'function'
          374  +  status INT, -- 0=normal, 1=experimental, 2=deprecated
          375  +  title TEXT, -- Documentation page title
          376  +  uri TEXT    -- Path to the documentation
          377  +);
          378  +}
          379  +proc convert_keyword_to_uri {key} {
          380  +  global glink hd
          381  +  if {[info exists glink($key)]} {
          382  +    set x $hd(rootpath-aux)$glink($key)
          383  +    regsub {^\.\./} $x {} x
          384  +    return $x
          385  +  } else {
          386  +    return unknown?key=$key
          387  +  }
          388  +}
          389  +
   367    390   
   368    391   # Do a table of contents for objects
   369    392   #
   370    393   set objlist {}
   371    394   foreach c $content {
   372    395     foreach {key title type keywords body code} $c break
   373    396     if {$type!="datatype"} continue
   374    397     set keywords [lsort -nocase $keywords]
   375    398     set k [preferred_keyword $keywords]
   376    399     set s $supported($k)
   377    400     foreach kw $keywords {
   378    401       if {[regexp {^sqlite} $kw]} {
   379    402         lappend objlist [list $k $kw $s]
          403  +      set uri [convert_keyword_to_uri $k]
          404  +      dbtoc eval {INSERT INTO toc(name,type,status,title,uri)
          405  +                   VALUES($kw,'object',$s,$title,$uri)}
   380    406       }
   381    407     }
   382    408   }
   383    409   hd_open_aux c3ref/objlist.html
   384    410   hd_header {List Of SQLite Objects}
   385    411   hd_enable_main 0
   386    412   hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
................................................................................
   406    432     if {$type!="constant"} continue
   407    433     set keywords [lsort $keywords]
   408    434     set k [preferred_keyword $keywords]
   409    435     set s $supported($k)
   410    436     foreach kw $keywords {
   411    437       if {[regexp {^SQLITE_} $kw] && ![regexp {[^A-Z_0-9]} $kw]} {
   412    438         lappend clist [list $kw $kw $s]
          439  +      set uri [convert_keyword_to_uri $kw]
          440  +      dbtoc eval {INSERT INTO toc(name,type,status,title,uri)
          441  +                   VALUES($kw,'constant',$s,$title,$uri)}
   413    442       }
   414    443     }
   415    444   }
   416    445   hd_open_aux c3ref/constlist.html
   417    446   hd_header {List Of SQLite Constants}
   418    447   hd_enable_main 0
   419    448   hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
................................................................................
   429    458   <a href="objlist.html">Objects</a> and
   430    459   <a href="funclist.html">Functions</a> and
   431    460   <a href="../rescode.html">Result Codes</a>.</p>}
   432    461   hd_enable_main 1
   433    462   hd_close_aux
   434    463   hd_putsnl {<hr>}
   435    464   
   436         -
   437    465   # Do a table of contents for functions
   438    466   #
   439    467   set funclist {}
   440    468   foreach c $content {
   441    469     foreach {key title type keywords body code} $c break
   442    470     if {$type!="function"} continue
   443    471     set keywords [lsort $keywords]
   444    472     set k [preferred_keyword $keywords]
   445    473     set s $supported($k)
   446    474     foreach kw $keywords {
   447    475       if {[regexp {^sqlite} $kw]} {
   448    476         lappend funclist [list $k $kw $s]
          477  +      set uri [convert_keyword_to_uri $k]
          478  +      dbtoc eval {INSERT INTO toc(name,type,status,title,uri)
          479  +                   VALUES($kw,'function',$s,$title,$uri)}
   449    480       }
   450    481     }
   451    482   }
   452    483   hd_open_aux c3ref/funclist.html
   453    484   hd_header {List Of SQLite Functions}
   454    485   hd_keywords *capi3ref_funclist {C-API function list}
   455    486   hd_enable_main 0
................................................................................
   467    498   hd_putsnl {<p>Other lists:
   468    499   <a href="constlist.html">Constants</a> and
   469    500   <a href="objlist.html">Objects</a> and
   470    501   <a href="../rescode.html">Result Codes</a></p>}
   471    502   hd_enable_main 1
   472    503   hd_close_aux
   473    504   hd_putsnl {<hr>}
          505  +dbtoc eval COMMIT
          506  +dbtoc close
   474    507   
   475    508   # Convert a fragment text label into a fragment name
   476    509   #
   477    510   proc hd_fragname {lbl} {
   478    511     regsub -all {[^a-z0-9]} [string tolower $lbl] {} lbl2
   479    512     return $lbl2
   480    513   }