summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2025-05-10 08:31:27 +0200
committerDamien George <damien@micropython.org>2025-05-16 11:52:03 +1000
commit6d74b4e3c15d0b677247ce02c459095d3cf03fc5 (patch)
treee72e9580a486fe8cbde5783c251f363aae07b0cd
parentea19f3b7358eba713d6bcea5d5fd141312cf2e9d (diff)
tools/gen-cpydiff.py: Ensure every item has at least 2 TOC levels.
Previously, the navigation ended up messy when the (long) description of the item became used as a 2nd level header, meaning that it was placed in the navigation. Check for this when generating cpydiff so that new cases don't sneak in unnoticed. Signed-off-by: Jeff Epler <jepler@gmail.com>
-rw-r--r--tools/gen-cpydiff.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/gen-cpydiff.py b/tools/gen-cpydiff.py
index 278023a4b..3bb928090 100644
--- a/tools/gen-cpydiff.py
+++ b/tools/gen-cpydiff.py
@@ -219,6 +219,8 @@ def gen_rst(results):
class_ = []
for output in results:
section = output.class_.split(",")
+ if len(section) < 2:
+ raise SystemExit("Each item must have at least 2 categories")
for i in range(len(section)):
section[i] = section[i].rstrip()
if section[i] in CLASSMAP: