Skip to content

Commit d540d67

Browse files
committed
refactor(docs-autogen): remove stale Mintlify references from tooling
Four stale Mintlify-era references flagged by @ajbozarth in review: - audit_coverage.py: error hint for missing symbols now points to docs/sidebars.ts (replaces obsolete docs/docs/docs.json reference) - generate-ast.py: update module docstring, rename tree_to_mintlify -> tree_to_nav, update argparse help text - decorate_api_mdx.py: update SidebarFix comment and --docs-root help text - check_docs.py: rename file_exists_mintlify -> file_exists_docs, update link-check description and diagnostic strings Signed-off-by: Nigel Jones <jonesn@uk.ibm.com> Assisted-by: Claude Code
1 parent 4356dd8 commit d540d67

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

docs/scripts/check_docs.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
Link checks
1717
-----------
1818
* Internal doc-to-doc links (relative paths within docs/docs/).
19-
* Mintlify absolute paths (/getting-started/installation etc.) resolved
20-
against docs/docs/ and docs.json navigation.
21-
* Mintlify Card href="..." attributes (JSX).
19+
* Absolute paths (/getting-started/installation etc.) resolved
20+
against docs/docs/.
21+
* Card href="..." attributes (JSX).
2222
* Links that escape docs/docs/ (e.g. ../../examples/) — these resolve
23-
on the local filesystem but NOT on the published Mintlify site. They
23+
on the local filesystem but NOT on the published docs site. They
2424
are flagged as errors: use a full GitHub URL instead.
2525
* External URLs (https://) — checked with a lightweight HEAD request.
2626
Failures are reported as warnings (network-dependent).
27-
* docs.json navbar links and nav page slugs.
2827
2928
Code checks
3029
-----------
@@ -66,7 +65,7 @@
6665

6766
SCRIPT_DIR = Path(__file__).resolve().parent
6867
REPO_ROOT = SCRIPT_DIR.parent.parent # docs/scripts/../../
69-
DOCS_ROOT = REPO_ROOT / "docs" / "docs" # Mintlify content root
68+
DOCS_ROOT = REPO_ROOT / "docs" / "docs" # docs content root
7069

7170
# Skip API reference pages (separate PR)
7271
SKIP_PREFIXES = ("api/",)
@@ -129,8 +128,8 @@ def strip_anchor(target: str) -> str:
129128
return target.split("#", 1)[0]
130129

131130

132-
def file_exists_mintlify(resolved: Path) -> bool:
133-
"""Check whether the resolved target exists, trying Mintlify
131+
def file_exists_docs(resolved: Path) -> bool:
132+
"""Check whether the resolved target exists, trying standard
134133
extension conventions (.md, .mdx, index files)."""
135134
if resolved.exists():
136135
return True
@@ -278,7 +277,7 @@ def run_link_checks(
278277
continue
279278

280279
resolved = DOCS_ROOT / target_clean.lstrip("/")
281-
if file_exists_mintlify(resolved):
280+
if file_exists_docs(resolved):
282281
if verbose:
283282
print(f" [ok] {rel}:{lineno} -> {raw_target}")
284283
else:
@@ -302,7 +301,7 @@ def run_link_checks(
302301
if not inside_docs:
303302
# It might still exist in the repo...
304303
if resolved.exists() or Path(str(resolved)).exists():
305-
# File exists in repo but won't work on Mintlify site
304+
# File exists in repo but escapes the docs root
306305
# Suggest the GitHub URL
307306
try:
308307
repo_rel = resolved.relative_to(REPO_ROOT)
@@ -311,7 +310,7 @@ def run_link_checks(
311310
suggested = "(could not compute GitHub URL)"
312311
errors.append(
313312
f" {rel}:{lineno} -> {raw_target}"
314-
f" [escapes docs/ — won't work on Mintlify."
313+
f" [escapes docs/ — won't resolve on published site."
315314
f" Suggest: {suggested}]"
316315
)
317316
else:
@@ -324,7 +323,7 @@ def run_link_checks(
324323
continue
325324

326325
# Normal internal link
327-
if file_exists_mintlify(resolved):
326+
if file_exists_docs(resolved):
328327
if verbose:
329328
print(f" [ok] {rel}:{lineno} -> {raw_target}")
330329
else:
@@ -336,7 +335,7 @@ def run_link_checks(
336335
if any(slug.startswith(pfx) for pfx in SKIP_PREFIXES):
337336
continue
338337
resolved = DOCS_ROOT / slug
339-
if not file_exists_mintlify(resolved):
338+
if not file_exists_docs(resolved):
340339
errors.append(f" docs.json nav: '{slug}' — file not found")
341340
elif verbose:
342341
print(f" [ok] docs.json nav: {slug}")

tooling/docs-autogen/audit_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ def main():
10531053
)
10541054
print(
10551055
" Fix: Run the doc generation pipeline to produce MDX for new symbols,\n"
1056-
" then add entries to docs/docs/docs.json navigation.\n"
1056+
" then add entries to docs/sidebars.ts.\n"
10571057
" uv run python tooling/docs-autogen/generate-ast.py"
10581058
)
10591059
print(f" Ref: {_COVERAGE_DOCS_URL}")

tooling/docs-autogen/decorate_api_mdx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ def process_mdx_file(
850850
text = inject_preamble(text, module_path, docstring_cache)
851851
text = normalize_rst_backticks(text)
852852

853-
# Step 3: SidebarFix injection disabled (Mintlify-only; site now uses Docusaurus)
853+
# Step 3: SidebarFix injection disabled (was Mintlify-only; no-op on Docusaurus)
854854

855855
# Step 3.5: Wrap bare doctest (>>>) blocks in fenced code blocks.
856856
# Must run before escape_mdx_syntax so the new fences are processed.
@@ -875,7 +875,7 @@ def process_mdx_file(
875875
def main() -> None:
876876
parser = argparse.ArgumentParser(description="Decorate API MDX files")
877877
parser.add_argument(
878-
"--docs-root", type=Path, default=None, help="Mintlify docs root directory"
878+
"--docs-root", type=Path, default=None, help="Docs root directory"
879879
)
880880
parser.add_argument(
881881
"--api-dir", type=Path, default=None, help="API directory containing MDX files"

tooling/docs-autogen/generate-ast.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""generate-ast.py — mdxify + postprocess docs pipeline.
33
44
Runs mdxify against the project's mellea package then postprocesses
5-
the generated MDX files into the Mintlify docs tree.
5+
the generated MDX files into the Docusaurus docs tree.
66
77
Requires mdxify to be installed in the current Python environment. Run via::
88
@@ -15,8 +15,7 @@
1515
4) Update frontmatter (title/sidebarTitle/description) from H1 + first paragraph
1616
5) Remove truly-empty MDX files
1717
6) Move generated docs to <docs-root>/api (replace existing)
18-
7) Build Mintlify API Reference nav (NO .mdx suffix)
19-
8) Merge by replacing ONLY: { "tab": "API Reference", ... } in docs.json
18+
7) Build API Reference nav tree (docs.json merge skipped in Docusaurus mode)
2019
"""
2120

2221
import argparse
@@ -583,14 +582,14 @@ def insert(node: dict[str, Any], parts: list[str], page_path: str) -> None:
583582
return root
584583

585584

586-
def tree_to_mintlify(node: dict[str, Any], group_name: str) -> dict[str, Any]:
585+
def tree_to_nav(node: dict[str, Any], group_name: str) -> dict[str, Any]:
587586
pages: list[Any] = []
588587
file_pages = node.get("__pages__", [])
589588
if file_pages:
590589
pages.extend(sorted(file_pages))
591590

592591
for k in sorted(x for x in node.keys() if x != "__pages__"):
593-
pages.append(tree_to_mintlify(node[k], k))
592+
pages.append(tree_to_nav(node[k], k))
594593

595594
return {"group": group_name, "pages": pages}
596595

@@ -785,7 +784,7 @@ def build_api_reference_tab_object(api_dir: Path, docs_root: Path) -> dict[str,
785784
mellea_pages = collect_pages_under(api_dir, "mellea", docs_root)
786785

787786
mellea_tree = build_tree_from_paths(mellea_pages)
788-
mellea_nav = tree_to_mintlify(mellea_tree, "mellea")
787+
mellea_nav = tree_to_nav(mellea_tree, "mellea")
789788

790789
return {
791790
"tab": NAV_TAB,
@@ -852,15 +851,17 @@ def build_and_merge_navigation(
852851
# -----------------------------
853852
def main() -> None:
854853
parser = argparse.ArgumentParser(
855-
description="Generate MDX API docs with mdxify, postprocess, and merge into the Mintlify docs tree."
854+
description="Generate MDX API docs with mdxify, postprocess, and merge into the Docusaurus docs tree."
856855
)
857856
parser.add_argument(
858-
"--docs-json", required=False, help="Path to docs.json to update."
857+
"--docs-json",
858+
required=False,
859+
help="Path to docs.json to update (legacy; ignored in Docusaurus mode).",
859860
)
860861
parser.add_argument(
861862
"--docs-root",
862863
required=False,
863-
help="Mintlify docs root (defaults to parent of docs.json).",
864+
help="Docs root directory (defaults to parent of docs.json).",
864865
)
865866
parser.add_argument(
866867
"--nav-only",

0 commit comments

Comments
 (0)