aboutsummaryrefslogtreecommitdiff
path: root/make-index
diff options
context:
space:
mode:
Diffstat (limited to 'make-index')
-rwxr-xr-xmake-index10
1 files changed, 10 insertions, 0 deletions
diff --git a/make-index b/make-index
index 5071d88..6911d03 100755
--- a/make-index
+++ b/make-index
@@ -9,8 +9,16 @@ set lines {}
set commands {}
array set cdict {}
set c 0
+set numlist 1
while {[gets $f buf] >= 0} {
+ # Handle auto numbered lists
+ if {[string match "#. *" $buf]} {
+ set buf "$numlist. [string range $buf 3 end]"
+ incr numlist
+ } elseif {$buf eq ""} {
+ set numlist 1
+ }
if {[string match "~~*" $buf]} {
if {[string match "*: *" $prev]} {
incr c
@@ -29,6 +37,8 @@ while {[gets $f buf] >= 0} {
}
}
}
+ # Handle TIP nnn references
+ regsub -all {TIP ([0-9]+)} $buf {https://core.tcl-lang.org/tips/doc/main/tip/\1.md[TIP \1]} buf
lappend lines $buf
set prev $buf
}