Check-in [cb0afa427f]

Login

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

Overview
Comment:Add some spacing to index.json, so fossil no longer considers it to be a binary file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:cb0afa427f5781a566b7978223a8a82577d5a3ceaf64f955ae2360e9c356a1a5
User & Date: jan.nijtmans 2018-07-30 15:36:01
Context
2018-07-30
15:40
Fix obsolete email address check-in: e976e75bed user: jan.nijtmans tags: trunk
15:36
Add some spacing to index.json, so fossil no longer considers it to be a binary file. check-in: cb0afa427f user: jan.nijtmans tags: trunk
2018-07-17
07:27
Tightened up the spec in a few places and added a few key examples. check-in: dcb0aecc9d user: dkf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.json.

cannot compute difference between binary files

Changes to scripts/mkhtmlindex.tcl.

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
...
229
230
231
232
233
234
235

236
237
238
239
240
241
242
    puts -nonewline $json "\{\"tip\": \{"
}

proc writeFooter {} {
    global index json max
    puts $index {</tbody></table>}
    puts $index {</div>}
    puts $json "\"@min\": 0, \"@max\": $max\}, \"@timestamp\": [clock seconds]\}"
}

proc encodeHTML {string} {
    return [string map {< &lt; > &gt; \" &quot; & &amp; ' &apos;} $string]
}

proc encodeJSON {string} {
................................................................................
    } else {
	puts $index "<td valign='top' colspan=2>[encodeHTML $type]</td>"
    }
    puts $index "<td valign='top'>[encodeHTML $state]</td>"
    puts $index "<td valign='top'>[encodeHTML $fields(title)]</td>"
    puts $index "</tr>"

    puts -nonewline $json "\"$number\": \{\"url\": [encodeJSON ./tip/$number.md],"
    foreach f [array names fields] {
	if {$f eq "author"} {
	    puts -nonewline $json "[encodeJSON $f]: \[[join [lmap a $fields($f) {encodeJSON $a}] ,]\],"
	} else {
	    puts -nonewline $json \
		"[encodeJSON $f]: [encodeJSON $fields($f)],"
	}
    }
    puts -nonewline $json \
	"\"is-jest\": [expr {$number in $jests ? {true} : {false}}]"
    puts -nonewline $json "\},"
}

proc loadTIPPreamble {number} {
    global dir
    set sourcefile [open [file join $dir tip/$number.md]]
    try {
................................................................................
    }
}

set dir [file join [file dirname [info script]] ..]
set index [open [file join $dir index.md] w+]
set json [open [file join $dir index.json] w+]
fconfigure $index -translation lf -encoding utf-8


writeHeader

set max 0
foreach tip [lsort -decreasing -dictionary [glob [file join $dir tip/*.md]]] {
    set number [file tail [file rootname $tip]]
    if {![string is integer -strict $number]} {







|







 







|


|


|



|







 







>







132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
...
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    puts -nonewline $json "\{\"tip\": \{"
}

proc writeFooter {} {
    global index json max
    puts $index {</tbody></table>}
    puts $index {</div>}
    puts $json "\n\t\"@min\": 0,\n\t\"@max\": $max\n\}, \"@timestamp\": [clock seconds]\}"
}

proc encodeHTML {string} {
    return [string map {< &lt; > &gt; \" &quot; & &amp; ' &apos;} $string]
}

proc encodeJSON {string} {
................................................................................
    } else {
	puts $index "<td valign='top' colspan=2>[encodeHTML $type]</td>"
    }
    puts $index "<td valign='top'>[encodeHTML $state]</td>"
    puts $index "<td valign='top'>[encodeHTML $fields(title)]</td>"
    puts $index "</tr>"

    puts -nonewline $json "\n\t\"$number\":\{\"url\":[encodeJSON ./tip/$number.md],"
    foreach f [array names fields] {
	if {$f eq "author"} {
	    puts -nonewline $json "[encodeJSON $f]:\[[join [lmap a $fields($f) {encodeJSON $a}] ,]\],"
	} else {
	    puts -nonewline $json \
		"[encodeJSON $f]:[encodeJSON $fields($f)],"
	}
    }
    puts -nonewline $json \
	"\"is-jest\":[expr {$number in $jests ? {true} : {false}}]"
    puts -nonewline $json "\},"
}

proc loadTIPPreamble {number} {
    global dir
    set sourcefile [open [file join $dir tip/$number.md]]
    try {
................................................................................
    }
}

set dir [file join [file dirname [info script]] ..]
set index [open [file join $dir index.md] w+]
set json [open [file join $dir index.json] w+]
fconfigure $index -translation lf -encoding utf-8
fconfigure $json -translation lf -encoding utf-8

writeHeader

set max 0
foreach tip [lsort -decreasing -dictionary [glob [file join $dir tip/*.md]]] {
    set number [file tail [file rootname $tip]]
    if {![string is integer -strict $number]} {