docs: show first 60 lines of mintlify output to identify failing page

This commit is contained in:
KaifAhmad1
2026-06-20 16:40:35 +05:30
parent 5ee1548c90
commit 4547e43dda
+7 -3
View File
@@ -252,9 +252,13 @@ def _() -> list[str]:
"could not be generated" not in combined: "could not be generated" not in combined:
return [] # Windows temp-cleanup noise; real CI runs on Linux return [] # Windows temp-cleanup noise; real CI runs on Linux
# Surface the last 20 lines so the failing page error is visible # Show first 60 lines (where per-page errors are logged) AND
tail = "\n".join(combined.strip().splitlines()[-20:]) # last 20 lines (where the summary error appears).
return [f"mintlify export failed (exit {result.returncode}):\n{tail}"] all_lines = combined.strip().splitlines()
head = "\n".join(all_lines[:60])
tail = "\n".join(all_lines[-20:]) if len(all_lines) > 60 else ""
output = head + ("\n...\n" + tail if tail else "")
return [f"mintlify export failed (exit {result.returncode}):\n{output}"]
return [] return []
except FileNotFoundError: except FileNotFoundError:
return ["npx not found — skipping Mintlify export check (Node.js required)"] return ["npx not found — skipping Mintlify export check (Node.js required)"]