From 8767b55eb67279f3d3fc3880c409f73b472dd280 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 13 Mar 2025 08:54:28 +1000 Subject: docs: support auto-numbered lists in docs When merging different branches it is annoying that numbered lists have to have consecutive numbers for asciidoc. So allow for auto-numbered lists to make this merging easier. Signed-off-by: Steve Bennett --- make-index | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.1