This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 602d5913 Indentation for Index
602d5913 is described below

commit 602d59131bcba52d0583ac812c83e59bca64c6b3
Author: Sebb <[email protected]>
AuthorDate: Sun Oct 27 22:29:02 2024 +0000

    Indentation for Index
---
 tools/boardminutes2html.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/boardminutes2html.py b/tools/boardminutes2html.py
index 3867dd39..ca873636 100755
--- a/tools/boardminutes2html.py
+++ b/tools/boardminutes2html.py
@@ -155,8 +155,20 @@ def text2html(inp, out, extrahdr=''):
     out.write('</pre>\n')
     out.write('<h2 id="index">Index</h2>\n')
     out.write('<ul>\n')
+    level = 1
     for link, text in links.items():
+        if re.search(r'\d[A-Z]{1,2}$', link): # second level link
+            if level == 1:
+                out.write('<ul>\n')
+                level = 2
+        else:
+            if level == 2:
+                out.write('</ul>\n')
+                level = 1
         out.write(f'<li><a href="#{link}">{text}</a></li>\n')
+    if level == 2:
+        out.write('</ul>\n')
+        level = 1
     out.write('</ul>\n')
     out.write(FTR)
 

Reply via email to