Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Further enhance backward compatibility of the 'vtab.tcl' doc tool. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
5a46d020f42c82834270b65f3a855d3b |
User & Date: | mistachkin 2016-09-12 21:35:16.749 |
Context
2016-09-13
| ||
21:54 | Minor simplification of the 'vtab.tcl' doc tool. check-in: f318af97f7 user: mistachkin tags: trunk | |
2016-09-12
| ||
21:35 | Further enhance backward compatibility of the 'vtab.tcl' doc tool. check-in: 5a46d020f4 user: mistachkin tags: trunk | |
21:28 | Pickup the SQLite core library 3.14.2 docs from upstream. check-in: 0d2c14e945 user: mistachkin tags: trunk | |
Changes
Changes to Doc/vtab.tcl.
︙ | ︙ | |||
44 45 46 47 48 49 50 | lappend result $element } } return $result } | | | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | lappend result $element } } return $result } proc processLine { line prefix ltAndGt } { if {[string length [string trim $line]] == 0 || \ [regexp -- {<h\d(?: |>)} [string range $line 0 3]] || \ [regexp -- {</p>\n<h\d(?: |>)} [string range $line 0 8]]} then { return "" } set result $line |
︙ | ︙ | |||
74 75 76 77 78 79 80 | } set indent " /// " regsub -all -- {≠} $result {\≠} result regsub -all -- {[(?:;)?} $result {[} result regsub -all -- {](?:;)?} $result {]} result | > > | | > > | | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | } set indent " /// " regsub -all -- {≠} $result {\≠} result regsub -all -- {[(?:;)?} $result {[} result regsub -all -- {](?:;)?} $result {]} result if {$ltAndGt} then { regsub -all -- {<( |\"|\d|=)} $result {\<\1} result regsub -all -- {( |\"|\d|=)>} $result {\1\>} result } regsub -all -- {<div class="codeblock"><pre>} $result \ <para><code>\n$indent result regsub -all -- {</pre></div>} $result </code></para> result regsub -all -- {<blockquote><pre>} $result <para><code> result regsub -all -- {</pre></blockquote>} $result </code></para> result regsub -all -- {<blockquote>} $result <para><code> result regsub -all -- {</blockquote>} $result </code></para> result return $result } proc extractMethod { name lines pattern prefix indexVarName methodsVarName ltAndGt } { upvar 1 $indexVarName index upvar 1 $methodsVarName methods array set levels {p 0} set length [llength $lines] while {$index < $length} { |
︙ | ︙ | |||
119 120 121 122 123 124 125 | } incr levels(p) -1 } elseif {[string range $trimLine 0 2] eq "<p>" || \ [string range $trimLine 0 6] eq "</p><p>"} then { # open tag ... maybe one line? if {[string range $trimLine end-3 end] eq "</p>"} then { | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | } incr levels(p) -1 } elseif {[string range $trimLine 0 2] eq "<p>" || \ [string range $trimLine 0 6] eq "</p><p>"} then { # open tag ... maybe one line? if {[string range $trimLine end-3 end] eq "</p>"} then { set newLine [processLine $line $prefix $ltAndGt] if {[string length $newLine] > 0} then { # one line tag, wrap. if {[info exists methods($name)]} then { # non-first line, leading line separator. append data \n $prefix <para> } else { |
︙ | ︙ | |||
143 144 145 146 147 148 149 | # non-first line, leading line separator. append data \n $prefix <para> } else { # first line, no leading line separator. append data $prefix <para> } | | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | # non-first line, leading line separator. append data \n $prefix <para> } else { # first line, no leading line separator. append data $prefix <para> } set newLine [processLine $line $prefix $ltAndGt] if {[string length $newLine] > 0} then { append data \n $prefix $newLine } incr levels(p) } } else { set newLine [processLine $line $prefix $ltAndGt] if {[string length $newLine] > 0} then { if {[info exists methods($name)]} then { # non-first line, leading line separator. append data \n $prefix $newLine } else { # first line, no leading line separator. |
︙ | ︙ | |||
201 202 203 204 205 206 207 208 209 210 211 212 213 214 | set inputData [readFile $inputFileName] set inputData [string map [list \ {<font size="6" color="red">*** DRAFT ***</font>} ""] $inputData] set inputData [string map [list {<p align="center"></p>} ""] $inputData] set lines [split [string map [list \r\n \n] $inputData] \n] set patterns(start) [string trim { ^(?:</p>\n)?<h1>(?:<span>)?2\. (?:</span>)?Virtual Table Methods</h1>$ }] | > > > > > > > | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | set inputData [readFile $inputFileName] set inputData [string map [list \ {<font size="6" color="red">*** DRAFT ***</font>} ""] $inputData] set inputData [string map [list {<p align="center"></p>} ""] $inputData] if {[string first <\; $inputData] != -1 || \ [string first >\; $inputData] != -1} then { set ltAndGt false } else { set ltAndGt true } set lines [split [string map [list \r\n \n] $inputData] \n] set patterns(start) [string trim { ^(?:</p>\n)?<h1>(?:<span>)?2\. (?:</span>)?Virtual Table Methods</h1>$ }] |
︙ | ︙ | |||
223 224 225 226 227 228 229 | set line [preProcessLine [lindex $lines $index]] if {$start} then { if {[regexp -- $patterns(method) $line dummy capture]} then { foreach method [englishToList $capture] { set methodIndex [expr {$index + 1}] | | | | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | set line [preProcessLine [lindex $lines $index]] if {$start} then { if {[regexp -- $patterns(method) $line dummy capture]} then { foreach method [englishToList $capture] { set methodIndex [expr {$index + 1}] extractMethod $method $lines $patterns(method) $prefix \ methodIndex methods $ltAndGt } set index $methodIndex } else { incr index } } elseif {[regexp -- $patterns(start) $line]} then { |
︙ | ︙ |