Merge rebuild into main #181

Merged
lilleman merged 258 commits from rebuild-merge into main 2026-10-01 23:01:38 +02:00
Showing only changes of commit ea29be4046 - Show all commits
+6 -6
View File
@@ -23,17 +23,17 @@ def read_premises(root):
def sections(text):
headings, fenced = [], False
blocks, fenced = [], False
for line in text.splitlines():
fenced ^= line.startswith("```")
if not fenced and line.startswith("## "):
headings.append((line.strip()[3:], []))
blocks.append((line.strip()[3:], []))
elif not fenced and line.startswith("# "):
headings.append((None, []))
elif headings and line.strip():
headings[-1][1].append(line)
blocks.append((None, []))
elif blocks and line.strip():
blocks[-1][1].append(line)
found = {}
for name, body in headings:
for name, body in blocks:
if name is not None:
found.setdefault(name, []).append("\n".join(body))
return found