-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (68 loc) · 2.48 KB
/
Copy pathdocs.yml
File metadata and controls
83 lines (68 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: docs
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Validate Mintlify navigation targets
run: |
python - <<'PY'
import json
from pathlib import Path
docs_root = Path("docs")
config = json.loads((docs_root / "docs.json").read_text(encoding="utf-8"))
missing: list[str] = []
for language in config.get("navigation", {}).get("languages", []):
for tab in language.get("tabs", []):
for group in tab.get("groups", []):
root = group.get("root")
if root:
root_path = docs_root / f"{root}.mdx"
if not root_path.exists():
missing.append(str(root_path))
for page in group.get("pages", []):
page_path = docs_root / f"{page}.mdx"
if not page_path.exists():
missing.append(str(page_path))
if missing:
print("Missing docs pages referenced by docs/docs.json:")
for item in missing:
print(f" - {item}")
raise SystemExit(1)
print("Mintlify navigation targets are valid.")
PY
- name: Validate bilingual tutorial parity
run: |
python - <<'PY'
from pathlib import Path
docs_root = Path("docs")
english = {
path.relative_to(docs_root).as_posix()
for path in docs_root.rglob("*.mdx")
if "zh/" not in path.relative_to(docs_root).as_posix()
and "blog/" not in path.relative_to(docs_root).as_posix()
and path.parent.name != "images"
}
missing_zh: list[str] = []
for rel in sorted(english):
zh_path = docs_root / "zh" / rel
if not zh_path.exists():
missing_zh.append(str(zh_path))
if missing_zh:
print("Missing Chinese mirror pages:")
for item in missing_zh:
print(f" - {item}")
raise SystemExit(1)
print("Chinese docs mirror covers all English docs pages.")
PY