Documentation Source Text

Check-in [9a1f417e0b]
Login

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

Overview
Comment:Modify the search script so that it does not index the header at the top of each page or generated TOCs.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a1f417e0b899360829179c498b7c5602639d1e9
User & Date: dan 2010-01-21 09:12:31
Context
2010-02-01
16:18
Fix a typo in the FTS3 documentation. check-in: f0a07e571f user: drh tags: trunk
2010-01-21
09:12
Modify the search script so that it does not index the header at the top of each page or generated TOCs. check-in: 9a1f417e0b user: dan tags: trunk
06:06
Change foreignkeys.in to be more similar to other documentation files. check-in: 7889bfe143 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to search/buildsearchdb.tcl.

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
..
98
99
100
101
102
103
104







105
106
107
108
109
110
111
...
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
      append P(text) " $details"
      if {$P(isTitle)} { append P(title) $details }
      if {[llength $P(fragments)]} { 
        append P(ftext) " $details" 
      }
    }

    "/table" {
      if {[info exists P(skipheader)]} {
        set P(text) ""
        unset P(skipheader)
      }
    }

    "title"  { set P(isTitle) 1 }
    "/title" { set P(isTitle) 0 }

    "a" { 
      array set D $details
      if {[info exists D(name)]} {
        if {[llength $P(fragments)]} { 
................................................................................
          lappend P(fragments) $P(ftitle) $P(ftext) 
        }
        lappend P(fragments) $D(id)
        set P(ftext) ""
        set P(ftitle) ""
      }
    }







  }

  set ftext [string trim $P(ftext) " \v\n"]
  if {[string length $ftext]>4 && $P(ftitle) == ""} {
    set blocktags [list                               \
      br td /td th /th p /p                           \
      h1 h2 h3 h4 h5 h /h1 /h2 /h3 /h4 /h5 /h
................................................................................

      array unset ::P
      set ::P(text) ""                 ;# The full document text
      set ::P(isTitle) 0               ;# True while parsing contents of <title>
      set ::P(fragments) [list]        ;# List of document fragments parsed
      set ::P(ftext) ""                ;# Text of current document fragment 

      # If the document appears to contain something that looks like the 
      # header on all website pages, set the P(skipheader) variable. This
      # tells the document parser to ignore all text (except for the document
      # title) up to the first </table> tag in the HTML.
      set tagline {<div class="tagline">Small. Fast. Reliable.}
      if {[string first $tagline $zHtml]>0} {
        set ::P(skipheader) 1
      }

      parsehtml $zHtml docparse_callback
      if {[info exists ::P(ftitle)]} {
        lappend ::P(fragments) $::P(ftitle) $::P(ftext)
      }

      set len [string length $::P(text)]
      set keyword ""







<
<
<
<
<
<
<







 







>
>
>
>
>
>
>







 







<
<
<
<
<
<
<
<
<







65
66
67
68
69
70
71







72
73
74
75
76
77
78
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
...
168
169
170
171
172
173
174









175
176
177
178
179
180
181
      append P(text) " $details"
      if {$P(isTitle)} { append P(title) $details }
      if {[llength $P(fragments)]} { 
        append P(ftext) " $details" 
      }
    }








    "title"  { set P(isTitle) 1 }
    "/title" { set P(isTitle) 0 }

    "a" { 
      array set D $details
      if {[info exists D(name)]} {
        if {[llength $P(fragments)]} { 
................................................................................
          lappend P(fragments) $P(ftitle) $P(ftext) 
        }
        lappend P(fragments) $D(id)
        set P(ftext) ""
        set P(ftitle) ""
      }
    }

    div {
      array set D $details
      if {[info exists D(class)] && $D(class) == "startsearch"} { 
        set P(text) "" 
      }
    }
  }

  set ftext [string trim $P(ftext) " \v\n"]
  if {[string length $ftext]>4 && $P(ftitle) == ""} {
    set blocktags [list                               \
      br td /td th /th p /p                           \
      h1 h2 h3 h4 h5 h /h1 /h2 /h3 /h4 /h5 /h
................................................................................

      array unset ::P
      set ::P(text) ""                 ;# The full document text
      set ::P(isTitle) 0               ;# True while parsing contents of <title>
      set ::P(fragments) [list]        ;# List of document fragments parsed
      set ::P(ftext) ""                ;# Text of current document fragment 










      parsehtml $zHtml docparse_callback
      if {[info exists ::P(ftitle)]} {
        lappend ::P(fragments) $::P(ftitle) $::P(ftext)
      }

      set len [string length $::P(text)]
      set keyword ""

Changes to wrap.tcl.

467
468
469
470
471
472
473

474
475
476
477
478
479
480
          <input type=submit value="Go" style="border:solid white 1px;background-color:#80a796;color:white;font-size:0.9em;padding:0 1ex">
        </form>
        </div>
      </table>}
  }
  putsin4 $fd {</div></div></div></div>
    </td></tr></table>

  }
  if {[file exists SEARCH]} {
    putsin4 $fd {<script>
      gMsg = "Search SQLite Docs..."
      function entersearch() {
        var q = document.getElementById("q");
        if( q.value == gMsg ) { q.value = "" }







>







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