Skip to content

Commit 59e84a4

Browse files
committed
新增分章节-guide,以及guide/mp文档
1 parent 16a5ac5 commit 59e84a4

File tree

56 files changed

+232
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+232
-4
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ yarn.lock
66

77
docs/.vitepress/cache/
88
docs/.vitepress/dist/
9-
*.mov
109

1110
test/

docs/.vitepress/theme/constrants/route.ts

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ export enum Chapters {
1919
xrobot_device = "/xrobot/device/",
2020
xrobot_api = "/xrobot/api/",
2121
xrobot_faq = "/xrobot/faq/",
22+
xrobot_guide = "/xrobot/guide",
23+
xrobot_guide_mp = "/xrobot/guide/mini-program",
2224
}
2325

24-
// 判断一个link是否是章节link
26+
// 判断一个link 字符串是否是章节link
2527
export function isChapter<T extends Record<string, string>>(
2628
link: string
2729
): link is T[keyof T] {
28-
return Object.values(Chapters).includes(link);
30+
return Object.values(Chapters).includes(link as Chapters);
2931
}
3032

33+
// 给 ChapterItem 的 link 字段追加当前章节的 link 前缀
3134
function apply_prefix(item: ChapterItem, prefix: Chapters) {
3235
if (item?.link.startsWith("/") && prefix.endsWith("/")) {
3336
return { ...item, link: prefix.slice(0, -1) + item.link };
@@ -78,11 +81,39 @@ const items_xrobot_faq = [
7881
// 子章节
7982
];
8083

84+
const items_xrobot_guide_mp = [
85+
{
86+
text: "微信小程序",
87+
link: Chapters.xrobot_guide_mp,
88+
collapsed: true,
89+
items: [
90+
{ text: "智能体管理", link: "agent-management" },
91+
{ text: "角色配置", link: "role-config" },
92+
{ text: "设备管理", link: "device-management" },
93+
{ text: "设备配网", link: "device-net-config" },
94+
].map((item) => apply_prefix(item, Chapters.xrobot_guide_mp)),
95+
},
96+
];
97+
98+
const items_xrobot_guide = [
99+
{
100+
text: "操作指南",
101+
link: Chapters.xrobot_guide,
102+
collapsed: false,
103+
items: [...items_xrobot_guide_mp],
104+
},
105+
];
106+
81107
// xrobot章节整体
82108
const items_xrobot = [
83109
{
84110
text: "Xrobot",
85-
items: [...items_xrobot_api, ...items_xrobot_device, ...items_xrobot_faq],
111+
items: [
112+
...items_xrobot_api,
113+
...items_xrobot_device,
114+
...items_xrobot_faq,
115+
...items_xrobot_guide,
116+
],
86117
link: Chapters.xrobot,
87118
collapsed: false,
88119
},
@@ -105,4 +136,9 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
105136
],
106137
[Chapters.xrobot_api]: [gobackItem(Chapters.xrobot), ...items_xrobot_api],
107138
[Chapters.xrobot_faq]: [gobackItem(Chapters.xrobot), ...items_xrobot_faq],
139+
[Chapters.xrobot_guide]: [gobackItem(Chapters.xrobot), ...items_xrobot_guide],
140+
[Chapters.xrobot_guide_mp]: [
141+
gobackItem(Chapters.xrobot_guide),
142+
...items_xrobot_guide_mp,
143+
],
108144
};

docs/xrobot/guide/index.md

Lines changed: 7 additions & 0 deletions
Lines changed: 23 additions & 0 deletions
Lines changed: 40 additions & 0 deletions
Lines changed: 83 additions & 0 deletions
71.8 KB
66 KB
103 KB
383 KB

0 commit comments

Comments
 (0)