Compare commits

...
Author SHA1 Message Date
MervinPraison 0b5eb93bb6 fix: update docs/docs.json path for Mintlify subpath hosting
Generator looked for docs.json at repo root; PraisonAIDocs uses
docs/docs.json so nav was never updated after auto-gen. Also run
sync_sdk_reference_nav.py after generation as a safety net.
2026-08-25 21:49:23 +01:00
MervinPraisonandMervin Praison 8da1746df8 fix(docs): report actual docs.json page count after legacy filtering
Legacy layout strips /index and /__init__ before writing package_group['pages'],
so logging len(unique_pages) overstated the count. Count the final navigation
entries instead (granular sums sub-group pages).

Co-authored-by: Mervin Praison <[email protected]>
2026-08-19 21:04:13 +00:00
MervinPraison 8928ed870a fix: stop swallowing docs.json nav update failures
Auto-generate was writing MDX without updating docs.json when update_docs_json failed silently, breaking nav-check on every docs PR.
2026-08-19 21:48:01 +01:00
2 changed files with 22 additions and 4 deletions

No files matched your search

+3
View File
@@ -77,6 +77,9 @@ jobs:
--package all \
--docs-root $(pwd)/praisonai-docs \
--source-root $(pwd)/praisonai-source
- name: Sync SDK reference navigation
run: python3 praisonai-docs/scripts/sync_sdk_reference_nav.py
env:
PYTHONPATH: $(pwd)/praisonai-tools
+19 -4
View File
@@ -3125,7 +3125,15 @@ class ReferenceDocsGenerator:
layout: LayoutType = LayoutType.GRANULAR
):
self.docs_root = Path(docs_root)
self.docs_json_path = self.docs_root / "docs.json"
# Mintlify subpath hosting uses docs/docs.json (see PraisonAIDocs migrate script).
docs_json_in_docs = self.docs_root / "docs" / "docs.json"
docs_json_at_root = self.docs_root / "docs.json"
if docs_json_in_docs.exists():
self.docs_json_path = docs_json_in_docs
elif docs_json_at_root.exists():
self.docs_json_path = docs_json_at_root
else:
self.docs_json_path = docs_json_in_docs
self.layout = layout
# Base source root - default to local development path if not provided
@@ -3327,9 +3335,16 @@ class ReferenceDocsGenerator:
with open(self.docs_json_path, 'w') as f:
json.dump(docs_config, f, indent=2)
except Exception:
pass
if self.layout == LayoutType.GRANULAR:
page_count = sum(len(group.get('pages', [])) for group in package_group['pages'])
else:
page_count = len(package_group['pages'])
print(f" Updated docs.json: {page_count} pages for {package_name}")
except Exception as exc:
print(f" Error updating docs.json for {package_name}: {exc}")
raise
if __name__ == "__main__":
import argparse