From 204b13781deb4a8670eeba4d46ca3875af1907b9 Mon Sep 17 00:00:00 2001 From: rootiest Date: Thu, 6 Aug 2026 16:00:48 -0400 Subject: [PATCH] docs: use indented text tables for abbreviations and strip CardGrid from concat --- docs/build-manual.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/build-manual.py b/docs/build-manual.py index f630d67..7b3070d 100644 --- a/docs/build-manual.py +++ b/docs/build-manual.py @@ -55,14 +55,17 @@ def _with_abbreviations(body: str, abbrs: dict[str, list[dict]]) -> str: """Inject generated abbreviation tables into the document placeholders.""" rendered_abbrs = {} for cat, items in abbrs.items(): - lines_cat = ["| Abbreviation | Description |", "|---|---|"] + lines_cat = [" Abbreviation Description", " ───────────────────────────────────────────────────────────────────"] for abbr in items: name = abbr["name"] desc = abbr["desc"] - # Escape pipes if any exist in name or desc - name = name.replace("|", "\\|") - desc = desc.replace("|", "\\|") - lines_cat.append(f"| `{name}` | {desc} |") + + # Left-pad description to ensure at least 2 spaces for cell split + name_part = name.ljust(16) + if len(name_part) < len(name) + 2: + name_part = name + " " + + lines_cat.append(f" {name_part}{desc}") rendered_abbrs[cat] = "\n".join(lines_cat) for cat, table in rendered_abbrs.items(): @@ -103,6 +106,7 @@ def build_concat(root: Path) -> str: body = _with_abbreviations(body, abbrs) if body: body = re.sub(r"\n*", "", body, flags=re.DOTALL) + body = re.sub(r"\n*", "", body, flags=re.DOTALL) body = re.sub(r"\[([^\]]+)\]\(/[^)]+\)", r"\1", body) chunks.append(mt.shift_headings(body, depth)) return "\n\n".join(chunks) + "\n"