From 9ab3d02b3067332dbf5da324afc55201df50c46c Mon Sep 17 00:00:00 2001
From: Michael Bommhardt-Richter <michael.bommhardt-richter@tu-dresden.de>
Date: Mon, 13 Mar 2023 11:22:34 +0100
Subject: [PATCH] Repair + added archive ignoring (not the best variant but
 works)

---
 .../util/check-toc-equals-page-headings.py             | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py b/doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py
index ec66904b4..e7d8c1693 100755
--- a/doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py
+++ b/doc.zih.tu-dresden.de/util/check-toc-equals-page-headings.py
@@ -1,6 +1,6 @@
-""" #!/usr/bin/env python
+#!/usr/bin/env python
+"""
 Check for consistency between TOC and page headings.
-Provide as an command line argument the path to the mkdocs.yml file.
 
 Author: Michael Bommhardt-Richter
 """
@@ -12,7 +12,7 @@ from pathlib import Path
 # {path/filename.md: [toc_heading, file_heading], ... }
 TOCData = dict()
 
-whitelist = ["index.md"]  # ["archive"]
+whitelist = ["index.md","archive/"]  # ["archive"]
 
 
 def get_heading_in_file(filename, docs_path):
@@ -52,11 +52,13 @@ def main():
         for key, value in TOCData.items():
             if key in whitelist:
                 continue
+            if whitelist[1] in key:
+                continue
             if value[0] == "Overview":
                 continue
             if value[0] != value[1]:
                 cnt += 1
-                print(f"{key:<40}{value[0]:<30} != {value[1]}")
+                print(f"{key:<40}{value[0]:<50} != {value[1]}")
         sys.exit(cnt)
     else:
         print("Error: Could not find mkdocs.yml file.")
-- 
GitLab