From 413b8d8fa1c42c09d284a6fafc9f4c121a05baef Mon Sep 17 00:00:00 2001 From: rootiest Date: Sun, 26 Jul 2026 19:51:44 -0400 Subject: [PATCH 1/8] feat(docs): add _as_aside detector for LABEL: callout paragraphs --- docs/build-manual.py | 26 +++++++++++++++++++++ docs/verify-manual.py | 54 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/docs/build-manual.py b/docs/build-manual.py index 979df64..29b8999 100644 --- a/docs/build-manual.py +++ b/docs/build-manual.py @@ -385,6 +385,32 @@ def _prettify_block(block: list[str], entry_name: str | None) -> str: return "\n\n".join(chunk for chunk in out if chunk.strip()) +ASIDE_LABELS: dict[str, tuple[str, str, str | None]] = { + "NOTE": ("note", "Note", None), + "IMPORTANT": ("note", "Important", "star"), + "TIP": ("tip", "Tip", None), + "HINT": ("tip", "Hint", "question-circle"), + "WARNING": ("caution", "Warning", "warning"), + "CAUTION": ("caution", "Caution", None), + "DANGER": ("danger", "Danger", None), +} +ASIDE_RE = re.compile(rf"^({'|'.join(ASIDE_LABELS)}):\s*(.*)$") + + +def _as_aside(para: list[str]) -> str | None: + """Render a `LABEL: ...` flat paragraph as a Starlight