aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmake-index8
1 files changed, 8 insertions, 0 deletions
diff --git a/make-index b/make-index
index 5071d88..3532551 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