fix(docs): update python slugifier to match starlight/github rules

Modified build-manual.py to strip punctuation and properly handle spaces/hyphens during link slug generation. This ensures top navigation link cards generated by the script actually match Starlight's URL format. Also fixed a few manual markdown links that mistakenly contained double dashes.
This commit is contained in:
2026-07-27 16:45:39 -04:00
parent 8dba8a31fe
commit d9c8000f68
3 changed files with 12 additions and 11 deletions
+2 -1
View File
@@ -621,7 +621,8 @@ def _inject_subheading_cards(body: str) -> str:
cards = []
for title in headings:
safe_title = _jsx_attr_escape(title)
slug = re.sub(r"[^a-z0-9]+", "-", title.lower()).strip("-")
slug = re.sub(r"[^\w\s-]", "", title.lower())
slug = re.sub(r"[-\s]+", "-", slug).strip("-")
cards.append(f' <LinkCard title="{safe_title}" href="#{slug}" />')
cardgrid = "<CardGrid>\n" + "\n".join(cards) + "\n</CardGrid>\n\n"