From de9a2c5489c90402600f25d6ebc148fcb176ea65 Mon Sep 17 00:00:00 2001 From: Mike Odnis Date: Sat, 9 May 2026 14:08:29 -0400 Subject: [PATCH] ci: short sidebarTitle frontmatter for .NET pages Sync from resq-software/docs#37. Adds sidebarTitle frontmatter so the Mintlify sidebar shows readable member names instead of fully qualified ones. --- .github/workflows/api-docs.yml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index 1b9f882..a55be75 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -221,6 +221,53 @@ jobs: sed -i "s| str: + paren = stem.find("(") + if paren == -1: + return stem.rsplit(".", 1)[-1] + pre = stem[:paren] + last_dot = pre.rfind(".") + member = stem[last_dot + 1:] + name, _, args = member.partition("(") + args = args.rstrip(")") + if not args: + return f"{name}()" + return f"{name}({', '.join(a.split('.')[-1] for a in args.split(','))})" + + def yaml_quote(s: str) -> str: + return "'" + s.replace("'", "''") + "'" + + count = 0 + for md in pathlib.Path(".").rglob("*.md"): + if md.name == "README.md": + continue + text = md.read_text(encoding="utf-8") + if text.startswith("---\n"): + continue + title = short_name(md.stem) + md.write_text( + f"---\nsidebarTitle: {yaml_quote(title)}\n---\n\n{text}", + encoding="utf-8", + ) + count += 1 + print(f" added sidebarTitle frontmatter to {count} files") + PY + - name: Prefix bare-filename intra-page links with ./ # Mintlify rejects bare-filename .md links as broken; # prefixing with ./ makes the resolver treat them as