Documentation Source Text
Check-in [9a1f417e0b]
Not logged in

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

Overview
SHA1 Hash:9a1f417e0b899360829179c498b7c5602639d1e9
Date: 2010-01-21 09:12:31
User: dan
Comment:Modify the search script so that it does not index the header at the top of each page or generated TOCs.
Tags And Properties
Changes
hide diffs unified diffs patch

Changes to search/buildsearchdb.tcl

65 append P(text) " $details" 65 append P(text) " $details" 66 if {$P(isTitle)} { append P(title) $details } 66 if {$P(isTitle)} { append P(title) $details } 67 if {[llength $P(fragments)]} { 67 if {[llength $P(fragments)]} { 68 append P(ftext) " $details" 68 append P(ftext) " $details" 69 } 69 } 70 } 70 } 71 71 72 "/table" { < 73 if {[info exists P(skipheader)]} { < 74 set P(text) "" < 75 unset P(skipheader) < 76 } < 77 } < 78 < 79 "title" { set P(isTitle) 1 } 72 "title" { set P(isTitle) 1 } 80 "/title" { set P(isTitle) 0 } 73 "/title" { set P(isTitle) 0 } 81 74 82 "a" { 75 "a" { 83 array set D $details 76 array set D $details 84 if {[info exists D(name)]} { 77 if {[info exists D(name)]} { 85 if {[llength $P(fragments)]} { 78 if {[llength $P(fragments)]} { ................................................................................................................................................................................ 98 lappend P(fragments) $P(ftitle) $P(ftext) 91 lappend P(fragments) $P(ftitle) $P(ftext) 99 } 92 } 100 lappend P(fragments) $D(id) 93 lappend P(fragments) $D(id) 101 set P(ftext) "" 94 set P(ftext) "" 102 set P(ftitle) "" 95 set P(ftitle) "" 103 } 96 } 104 } 97 } > 98 > 99 div { > 100 array set D $details > 101 if {[info exists D(class)] && $D(class) == "startsearch"} { > 102 set P(text) "" > 103 } > 104 } 105 } 105 } 106 106 107 set ftext [string trim $P(ftext) " \v\n"] 107 set ftext [string trim $P(ftext) " \v\n"] 108 if {[string length $ftext]>4 && $P(ftitle) == ""} { 108 if {[string length $ftext]>4 && $P(ftitle) == ""} { 109 set blocktags [list \ 109 set blocktags [list \ 110 br td /td th /th p /p \ 110 br td /td th /th p /p \ 111 h1 h2 h3 h4 h5 h /h1 /h2 /h3 /h4 /h5 /h 111 h1 h2 h3 h4 h5 h /h1 /h2 /h3 /h4 /h5 /h ................................................................................................................................................................................ 168 168 169 array unset ::P 169 array unset ::P 170 set ::P(text) "" ;# The full document text 170 set ::P(text) "" ;# The full document text 171 set ::P(isTitle) 0 ;# True while parsing contents of <title> 171 set ::P(isTitle) 0 ;# True while parsing contents of <title> 172 set ::P(fragments) [list] ;# List of document fragments parsed 172 set ::P(fragments) [list] ;# List of document fragments parsed 173 set ::P(ftext) "" ;# Text of current document fragment 173 set ::P(ftext) "" ;# Text of current document fragment 174 174 175 # If the document appears to contain something that looks like the < 176 # header on all website pages, set the P(skipheader) variable. This < 177 # tells the document parser to ignore all text (except for the document < 178 # title) up to the first </table> tag in the HTML. < 179 set tagline {<div class="tagline">Small. Fast. Reliable.} < 180 if {[string first $tagline $zHtml]>0} { < 181 set ::P(skipheader) 1 < 182 } < 183 < 184 parsehtml $zHtml docparse_callback 175 parsehtml $zHtml docparse_callback 185 if {[info exists ::P(ftitle)]} { 176 if {[info exists ::P(ftitle)]} { 186 lappend ::P(fragments) $::P(ftitle) $::P(ftext) 177 lappend ::P(fragments) $::P(ftitle) $::P(ftext) 187 } 178 } 188 179 189 set len [string length $::P(text)] 180 set len [string length $::P(text)] 190 set keyword "" 181 set keyword ""

Changes to wrap.tcl

467 <input type=submit value="Go" style="border:solid white 1px;background 467 <input type=submit value="Go" style="border:solid white 1px;background 468 </form> 468 </form> 469 </div> 469 </div> 470 </table>} 470 </table>} 471 } 471 } 472 putsin4 $fd {</div></div></div></div> 472 putsin4 $fd {</div></div></div></div> 473 </td></tr></table> 473 </td></tr></table> > 474 <div class=startsearch></div> 474 } 475 } 475 if {[file exists SEARCH]} { 476 if {[file exists SEARCH]} { 476 putsin4 $fd {<script> 477 putsin4 $fd {<script> 477 gMsg = "Search SQLite Docs..." 478 gMsg = "Search SQLite Docs..." 478 function entersearch() { 479 function entersearch() { 479 var q = document.getElementById("q"); 480 var q = document.getElementById("q"); 480 if( q.value == gMsg ) { q.value = "" } 481 if( q.value == gMsg ) { q.value = "" }