Skip to content

Commit d22c7ff

Browse files
committed
调整目录结构,新增guide最佳实践章节,调增paltform/net-config篇到paltform/device下
1 parent 4325591 commit d22c7ff

File tree

22 files changed

+176
-12
lines changed

22 files changed

+176
-12
lines changed

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

Lines changed: 108 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,24 @@ export enum Chapters {
2020
xrobot = "/xrobot/",
2121
// guide
2222
xrobot_guide = "/xrobot/guide/",
23+
xrobot_guide_quick_start = "/xrobot/guide/quick-start/",
24+
xrobot_guide_xiaozhi_firmware = "/xrobot/guide/xiaozhi-firmware/",
25+
xrobot_guide_xiaozhi_hardware = "/xrobot/guide/xiaozhi-hardware/",
26+
xrobot_guide_platform_mp = "/xrobot/guide/platform-mp/",
2327
// api
2428
xrobot_api = "/xrobot/api/",
2529
xrobot_api_server = "/xrobot/api/server/",
2630
// xrobot_api_client = "/xrobot/api/client/",
2731
xrobot_api_protocol = "/xrobot/api/protocol/",
32+
xrobot_api_mcp = "/xrobot/api/mcp/",
2833
// platform
2934
xrobot_platform = "/xrobot/platform/",
3035
xrobot_platform_esp32 = "/xrobot/platform/esp32/",
3136
xrobot_platform_others = "/xrobot/platform/others/",
3237
xrobot_platform_others_mp = "/xrobot/platform/others/mini-program/",
3338
xrobot_platform_others_console = "/xrobot/platform/others/console/",
3439
xrobot_platform_others_device = "/xrobot/platform/others/device/",
35-
xrobot_platform_others_device_net_config = "/xrobot/platform/others/net-config/",
40+
xrobot_platform_others_device_net_config = "/xrobot/platform/others/device/net-config/",
3641
xrobot_platform_others_device_device_bind = "/xrobot/platform/others/device/device-bind/",
3742
// faq
3843
xrobot_faq = "/xrobot/faq/",
@@ -78,7 +83,7 @@ export function apply_prefix(item: ChapterItem, prefix: Chapters) {
7883
return { ...item, link: prefix + item.link };
7984
}
8085

81-
export const items_xrobot_api_server = [
86+
const items_xrobot_api_server = [
8287
{
8388
text: "平台接入API",
8489
collapsed: true,
@@ -92,7 +97,7 @@ export const items_xrobot_api_server = [
9297
},
9398
];
9499

95-
// export const items_xrobot_api_client = [
100+
// const items_xrobot_api_client = [
96101
// {
97102
// text: "设备接入协议",
98103
// collapsed: true,
@@ -101,7 +106,7 @@ export const items_xrobot_api_server = [
101106
// },
102107
// ];
103108

104-
export const items_xrobot_api_protocol = [
109+
const items_xrobot_api_protocol = [
105110
{
106111
text: "设备接入协议",
107112
collapsed: true,
@@ -114,7 +119,15 @@ export const items_xrobot_api_protocol = [
114119
},
115120
];
116121

117-
export const items_xrobot_api = [
122+
const items_xrobot_api_mcp = [
123+
{
124+
text: "MCP接入",
125+
link: Chapters.xrobot_api_mcp,
126+
items: [].map((item) => apply_prefix(item, Chapters.xrobot_api_mcp)),
127+
},
128+
];
129+
130+
const items_xrobot_api = [
118131
{
119132
text: "API参考",
120133
// collapsed: false,
@@ -123,11 +136,12 @@ export const items_xrobot_api = [
123136
...items_xrobot_api_server,
124137
// ...items_xrobot_api_client,
125138
...items_xrobot_api_protocol,
139+
...items_xrobot_api_mcp,
126140
],
127141
},
128142
];
129143

130-
export const items_xrobot_platform_mp = [
144+
const items_xrobot_platform_mp = [
131145
{
132146
text: "微信小程序",
133147
link: Chapters.xrobot_platform_others_mp,
@@ -169,7 +183,7 @@ const items_xrobot_platform_device_bind = [
169183
},
170184
];
171185

172-
export const items_xrobot_platform_device = [
186+
const items_xrobot_platform_device = [
173187
{
174188
text: "设备配置与使用",
175189
link: Chapters.xrobot_platform_others_device,
@@ -199,7 +213,72 @@ const items_xrobot_platform_console = [
199213
},
200214
];
201215

202-
export const items_xrobot_guide = [];
216+
const items_xrobot_guide_quick_start = [
217+
{
218+
text: "快速入门",
219+
link: Chapters.xrobot_guide_quick_start,
220+
collapsed: false,
221+
items: [{ text: "创建智能体", link: "create-agent" }].map((item) =>
222+
apply_prefix(item, Chapters.xrobot_guide_quick_start)
223+
),
224+
},
225+
];
226+
227+
const items_xrobot_guide_xiaozhi_firmware = [
228+
{
229+
text: "小智固件接入",
230+
link: Chapters.xrobot_guide_xiaozhi_firmware,
231+
collapsed: true,
232+
items: [
233+
...[
234+
{ text: "编译小智固件", link: "compile" },
235+
{ text: "配网高级选项", link: "advanced-options" },
236+
].map((item) =>
237+
apply_prefix(item, Chapters.xrobot_guide_xiaozhi_firmware)
238+
),
239+
...items_xrobot_guide_quick_start.flatMap((item) => ({
240+
text: item.text,
241+
link: item.link,
242+
})),
243+
],
244+
},
245+
];
246+
247+
const items_xrobot_guide_xiaozhi_hardware = [
248+
{
249+
text: "小智硬件接入",
250+
link: Chapters.xrobot_guide_xiaozhi_hardware,
251+
collapsed: true,
252+
items: [].map((item) =>
253+
apply_prefix(item, Chapters.xrobot_guide_xiaozhi_hardware)
254+
),
255+
},
256+
];
257+
const items_xrobot_guide_platform_mp = [
258+
{
259+
text: "平台小程序接入",
260+
link: Chapters.xrobot_guide_platform_mp,
261+
collapsed: true,
262+
items: [].map((item) =>
263+
apply_prefix(item, Chapters.xrobot_guide_platform_mp)
264+
),
265+
},
266+
];
267+
268+
const items_xrobot_guide = [
269+
{
270+
text: "最佳实践",
271+
link: Chapters.xrobot_guide,
272+
collapsed: false,
273+
items: [
274+
...items_xrobot_guide_quick_start,
275+
...items_xrobot_guide_xiaozhi_firmware,
276+
...items_xrobot_guide_xiaozhi_hardware,
277+
...items_xrobot_guide_platform_mp,
278+
],
279+
// .map((item) => apply_prefix(item, Chapters.xrobot_guide)),
280+
},
281+
];
203282

204283
const items_xrobot_platform_esp32 = [
205284
{
@@ -213,7 +292,6 @@ const items_xrobot_platform_esp32 = [
213292
},
214293
];
215294

216-
// todo: 调整guide内容位置
217295
const items_xrobot_platform_others = [
218296
{
219297
text: "厂商接入指南",
@@ -287,8 +365,28 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
287365
gobackItem(Chapters.xrobot_api),
288366
...items_xrobot_api_protocol,
289367
],
368+
[Chapters.xrobot_api_mcp]: [
369+
gobackItem(Chapters.xrobot_api),
370+
...items_xrobot_api_mcp,
371+
],
290372
// guide
291373
[Chapters.xrobot_guide]: [gobackItem(Chapters.xrobot), ...items_xrobot_guide],
374+
[Chapters.xrobot_guide_quick_start]: [
375+
gobackItem(Chapters.xrobot),
376+
...items_xrobot_guide_quick_start,
377+
],
378+
[Chapters.xrobot_guide_xiaozhi_firmware]: [
379+
gobackItem(Chapters.xrobot),
380+
...items_xrobot_guide_xiaozhi_firmware,
381+
],
382+
[Chapters.xrobot_guide_xiaozhi_hardware]: [
383+
gobackItem(Chapters.xrobot),
384+
...items_xrobot_guide_xiaozhi_hardware,
385+
],
386+
[Chapters.xrobot_guide_platform_mp]: [
387+
gobackItem(Chapters.xrobot),
388+
...items_xrobot_guide_platform_mp,
389+
],
292390
// platform
293391
[Chapters.xrobot_platform]: [
294392
gobackItem(Chapters.xrobot),
@@ -324,6 +422,7 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
324422
gobackItem(Chapters.xrobot_platform_others),
325423
...items_xrobot_platform_device_bind,
326424
],
425+
// platform - others END
327426
// faq
328427
[Chapters.xrobot_faq]: [gobackItem(Chapters.xrobot), ...items_xrobot_faq],
329428
};

docs/xrobot/api/mcp/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script setup>
2+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
3+
4+
const chapter_root = Chapters.xrobot_api_mcp;
5+
</script>
6+
7+
<ChapterContents :chapter=chapter_root />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 平台小程序接入
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_platform_mp;
9+
</script>
10+
11+
<ChapterContents :chapter=chapter_root />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 创建智能体
3+
---
4+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 快速入门
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_quick_start;
9+
</script>
10+
11+
<ChapterContents :chapter=chapter_root />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 配网高级选项
3+
---
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 编译小智固件
3+
---
4+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 小智开源固件项目接入
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_xiaozhi_firmware;
9+
</script>
10+
11+
<ChapterContents :chapter=chapter_root />
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: 小智硬件接入
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_xiaozhi_firmware;
9+
</script>
10+
11+
<!-- todo -->
12+
13+
<ChapterContents :chapter=chapter_root />

docs/xrobot/platform/others/device/device-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bin 固件烧录后,设备保持接通电源状态,重启设备,设备进
4545

4646
### 3)配网步骤
4747

48-
具体配网流程参考同章节的 [配网篇](../net-config/index)
48+
具体配网流程参考同章节的 [配网篇](net-config/index)
4949

5050
## 4. 绑定设备
5151

0 commit comments

Comments
 (0)