Subversion Repositories Koakuma

Rev

Rev 38 | Rev 43 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 38 Rev 39
Line 1... Line 1...
1
#!/usr/bin/env tclsh
1
#!/usr/bin/env tclsh
2
# $Id: koakuma.cgi.in 38 2024-10-02 09:55:14Z nishi $
2
# $Id: koakuma.cgi.in 39 2024-10-02 09:56:33Z nishi $
3
 
3
 
4
set KOAKUMA_VERSION "1.00"
4
set KOAKUMA_VERSION "1.00"
5
set components ""
5
set components ""
6
 
6
 
7
chan configure stdout -buffering none
7
chan configure stdout -buffering none
Line 278... Line 278...
278
	if { "$has_toc" == "1" } {
278
	if { "$has_toc" == "1" } {
279
		rputs	"		<div id=\"toc\">"
279
		rputs	"		<div id=\"toc\">"
280
		rputs	"			<div id=\"tocinside\">"
280
		rputs	"			<div id=\"tocinside\">"
281
		rputs	"				<span id=\"toctitle\">TOC</span><hr>"
281
		rputs	"				<span id=\"toctitle\">TOC</span><hr>"
282
		foreach sect $toc {
282
		foreach sect $toc {
283
			if { "[string range "[regsub -all { } "$sect" "-"]" 0 0]" == "-" } {
283
			if { "[string range "[sanitize "$sect"]" 0 0]" == "-" } {
284
				rputs "<a class=\"shiftlink\" href=\"#TOC-[sanitize "[regsub {^-} "$sect" ""]"]\">[regsub {^-} "$sect" ""]</a><br>"
284
				rputs "<a class=\"shiftlink\" href=\"#TOC-[sanitize "[regsub {^-} "$sect" ""]"]\">[regsub {^-} "$sect" ""]</a><br>"
285
			} else {
285
			} else {
286
				rputs "<a href=\"#TOC-[sanitize "$sect"]\">$sect</a><br>"
286
				rputs "<a href=\"#TOC-[sanitize "$sect"]\">$sect</a><br>"
287
			}
287
			}
288
		}
288
		}
Line 306... Line 306...
306
	rputs	"</html>"
306
	rputs	"</html>"
307
}
307
}
308
 
308
 
309
proc add_toc {data} {
309
proc add_toc {data} {
310
	global toc
310
	global toc
311
	tputs	"<h2 id=\"TOC-[sanitize "$data"]\"><a href=\"#TOC-[sanitize "$data" "-"]\">#</a> $data</h2>"
311
	tputs	"<h2 id=\"TOC-[sanitize "$data"]\"><a href=\"#TOC-[sanitize "$data"]\">#</a> $data</h2>"
312
	lappend toc "$data"
312
	lappend toc "$data"
313
}
313
}
314
 
314
 
315
proc add_toc2 {data} {
315
proc add_toc2 {data} {
316
	global toc
316
	global toc