Skip to content

Commit f63c1f0

Browse files
committed
文档优化
1 parent 92a392d commit f63c1f0

File tree

148 files changed

+617
-286
lines changed

Some content is hidden

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

148 files changed

+617
-286
lines changed

docs/.vitepress/config.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export default defineConfig({
2727
outline: [2, 4],
2828
nav: [
2929
{ text: "主页", link: "/" },
30-
{ text: "开发文档", link: Chapters.xrobot_platform },
31-
{ text: "API参考", link: Chapters.xrobot_api },
32-
{ text: "最佳实践", link: Chapters.xrobot_platform_esp32 },
30+
{ text: "开发文档", link: Chapters.xrobot },
31+
{ text: "API", link: Chapters.xrobot_api },
32+
{ text: "最佳实践", link: Chapters.xrobot_guide },
3333
{ text: "FAQ", link: Chapters.xrobot_faq },
3434
],
3535
sidebar: sidebarItems,

docs/.vitepress/theme/components/ChapterContents.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ if (!items) {
6363

6464
<template>
6565
<h2 v-if="root">目录</h2>
66+
<slot name="header"></slot>
6667
<div v-for="(subchapter, index) in tocs">
6768
<h3>{{ chapter_name[index] }}</h3>
6869
<div v-if="subchapter.length === 0"><span>暂无内容</span></div>

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

Lines changed: 71 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,21 @@ export type ChapterItem = {
1818
export enum Chapters {
1919
// xrobot 主章节
2020
xrobot = "/xrobot/",
21+
// platform
22+
xrobot_platform = "/xrobot/platform/",
23+
// api
24+
xrobot_api = "/xrobot/api/",
25+
xrobot_api_server = "/xrobot/api/server/",
26+
// xrobot_api_client = "/xrobot/api/client/",
27+
// mcp
28+
xrobot_mcp = "/xrobot/mcp/",
2129
// guide
2230
xrobot_guide = "/xrobot/guide/",
2331
xrobot_guide_quick_start = "/xrobot/guide/quick-start/",
32+
xrobot_guide_quick_start_net_config = "/xrobot/guide/quick-start/net-config/",
2433
xrobot_guide_xiaozhi_firmware = "/xrobot/guide/xiaozhi-firmware/",
2534
xrobot_guide_xiaozhi_hardware = "/xrobot/guide/xiaozhi-hardware/",
2635
xrobot_guide_platform_mp = "/xrobot/guide/platform-mp/",
27-
// api
28-
xrobot_api = "/xrobot/api/",
29-
xrobot_api_server = "/xrobot/api/server/",
30-
// xrobot_api_client = "/xrobot/api/client/",
31-
xrobot_api_protocol = "/xrobot/api/protocol/",
32-
xrobot_api_mcp = "/xrobot/api/mcp/",
33-
// platform
34-
xrobot_platform = "/xrobot/platform/",
35-
xrobot_platform_esp32 = "/xrobot/platform/esp32/",
36-
xrobot_platform_others = "/xrobot/platform/others/",
37-
xrobot_platform_others_mp = "/xrobot/platform/others/mini-program/",
38-
xrobot_platform_others_console = "/xrobot/platform/others/console/",
39-
xrobot_platform_others_device = "/xrobot/platform/others/device/",
40-
xrobot_platform_others_device_net_config = "/xrobot/platform/others/device/net-config/",
41-
xrobot_platform_others_device_device_bind = "/xrobot/platform/others/device/device-bind/",
4236
// faq
4337
xrobot_faq = "/xrobot/faq/",
4438
}
@@ -83,9 +77,22 @@ export function apply_prefix(item: ChapterItem, prefix: Chapters) {
8377
return { ...item, link: prefix + item.link };
8478
}
8579

80+
const items_xrobot_platform = [
81+
{
82+
text: "设备接入协议",
83+
link: Chapters.xrobot_platform,
84+
// collapsed: false,
85+
items: [
86+
{ text: "OTA", link: "OTA" },
87+
{ text: "websocket", link: "websocket" },
88+
{ text: "MQTT", link: "MQTT" },
89+
].map((item) => apply_prefix(item, Chapters.xrobot_platform)),
90+
},
91+
];
92+
8693
const items_xrobot_api_server = [
8794
{
88-
text: "平台接入API",
95+
text: "服务端 API",
8996
collapsed: true,
9097
link: Chapters.xrobot_api_server,
9198
items: [
@@ -106,109 +113,43 @@ const items_xrobot_api_server = [
106113
// },
107114
// ];
108115

109-
const items_xrobot_api_protocol = [
110-
{
111-
text: "设备接入协议",
112-
collapsed: true,
113-
link: Chapters.xrobot_api_protocol,
114-
items: [
115-
{ text: "WebSocket 协议", link: "websocket" },
116-
{ text: "MQTT 协议", link: "MQTT" },
117-
{ text: "OTA协议", link: "OTA" },
118-
].map((item) => apply_prefix(item, Chapters.xrobot_api_protocol)),
119-
},
120-
];
121-
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-
130116
const items_xrobot_api = [
131117
{
132-
text: "API参考",
118+
text: "平台API",
133119
// collapsed: false,
134120
link: Chapters.xrobot_api,
135121
items: [
136122
...items_xrobot_api_server,
137123
// ...items_xrobot_api_client,
138-
...items_xrobot_api_protocol,
139-
...items_xrobot_api_mcp,
140124
],
141125
},
142126
];
143127

144-
const items_xrobot_platform_mp = [
128+
const items_xrobot_mcp = [
145129
{
146-
text: "微信小程序",
147-
link: Chapters.xrobot_platform_others_mp,
148-
collapsed: true,
149-
items: [
150-
{ text: "智能体管理", link: "agent-management" },
151-
{ text: "角色配置", link: "role-config" },
152-
{ text: "设备管理", link: "device-management" },
153-
{ text: "设备配网", link: "device-net-config" },
154-
].map((item) => apply_prefix(item, Chapters.xrobot_platform_others_mp)),
155-
},
156-
];
157-
158-
const items_xrobot_platform_net_config = [
159-
{
160-
text: "配网",
161-
link: Chapters.xrobot_platform_others_device_net_config,
162-
collapsed: true,
130+
text: "MCP接入",
131+
// collapsed: false,
132+
link: Chapters.xrobot_mcp,
163133
items: [
164-
{ text: "通过微信小程序", link: "mp" },
165-
{ text: "通过浏览器", link: "browser" },
134+
// { text: "硬件MCP", link: "hardware-mcp" },
135+
// { text: "软件MCP", link: "software-mcp" },
166136
].map((item) =>
167-
apply_prefix(item, Chapters.xrobot_platform_others_device_net_config)
137+
apply_prefix(item, Chapters.xrobot_mcp)
168138
),
169139
},
170140
];
171141

172-
const items_xrobot_platform_device_bind = [
142+
// 设备接入指南
143+
const items_xrobot_platform_net_config = [
173144
{
174-
text: "绑定设备",
175-
link: Chapters.xrobot_platform_others_device_device_bind,
145+
text: "配网",
146+
link: Chapters.xrobot_guide_quick_start_net_config,
176147
collapsed: true,
177148
items: [
178149
{ text: "通过微信小程序", link: "mp" },
179150
{ text: "通过浏览器", link: "browser" },
180151
].map((item) =>
181-
apply_prefix(item, Chapters.xrobot_platform_others_device_device_bind)
182-
),
183-
},
184-
];
185-
186-
const items_xrobot_platform_device = [
187-
{
188-
text: "设备配置与使用",
189-
link: Chapters.xrobot_platform_others_device,
190-
collapsed: true,
191-
items: [
192-
...[{ text: "设备基本配置流程说明", link: "device-intro" }].map((item) =>
193-
apply_prefix(item, Chapters.xrobot_platform_others_device)
194-
),
195-
...items_xrobot_platform_net_config,
196-
...items_xrobot_platform_device_bind,
197-
],
198-
},
199-
];
200-
201-
const items_xrobot_platform_console = [
202-
{
203-
text: "控制台(智控台)",
204-
link: Chapters.xrobot_platform_others_console,
205-
collapsed: true,
206-
items: [
207-
// { text: "基本介绍", link: "intro" },
208-
{ text: "智能体连接指南", link: "device-connection" },
209-
{ text: "设备绑定", link: "device-bind" },
210-
].map((item) =>
211-
apply_prefix(item, Chapters.xrobot_platform_others_console)
152+
apply_prefix(item, Chapters.xrobot_guide_quick_start_net_config)
212153
),
213154
},
214155
];
@@ -218,9 +159,17 @@ const items_xrobot_guide_quick_start = [
218159
text: "快速入门",
219160
link: Chapters.xrobot_guide_quick_start,
220161
collapsed: false,
221-
items: [{ text: "创建智能体", link: "create-agent" }].map((item) =>
222-
apply_prefix(item, Chapters.xrobot_guide_quick_start)
223-
),
162+
items: [
163+
...[{ text: "设备基本配置流程说明", link: "device-intro" }].map((item) =>
164+
apply_prefix(item, Chapters.xrobot_guide_quick_start)
165+
),
166+
...items_xrobot_platform_net_config,
167+
...[
168+
{ text: "智能体连接指南", link: "device-connection" },
169+
].map((item) =>
170+
apply_prefix(item, Chapters.xrobot_guide_quick_start)
171+
),
172+
]
224173
},
225174
];
226175

@@ -231,8 +180,10 @@ const items_xrobot_guide_xiaozhi_firmware = [
231180
collapsed: true,
232181
items: [
233182
...[
234-
{ text: "编译小智固件", link: "compile" },
235-
{ text: "配网高级选项", link: "advanced-options" },
183+
{ text: "灵矽 固件 & 服务", link: "lingxi-service" },
184+
{ text: "编译小智固件", link: "firmware-compilation" },
185+
{ text: "烧录固件", link: "flashing" },
186+
{ text: "设备绑定", link: "device-bind" },
236187
].map((item) =>
237188
apply_prefix(item, Chapters.xrobot_guide_xiaozhi_firmware)
238189
),
@@ -249,7 +200,12 @@ const items_xrobot_guide_xiaozhi_hardware = [
249200
text: "小智硬件接入",
250201
link: Chapters.xrobot_guide_xiaozhi_hardware,
251202
collapsed: true,
252-
items: [].map((item) =>
203+
items: [
204+
{ text: "智能体管理", link: "agent-management" },
205+
{ text: "角色配置", link: "role-config" },
206+
{ text: "设备管理", link: "device-management" },
207+
{ text: "设备配网", link: "device-net-config" },
208+
].map((item) =>
253209
apply_prefix(item, Chapters.xrobot_guide_xiaozhi_hardware)
254210
),
255211
},
@@ -280,40 +236,6 @@ const items_xrobot_guide = [
280236
},
281237
];
282238

283-
const items_xrobot_platform_esp32 = [
284-
{
285-
text: "小智接入指南 (ESP32)",
286-
link: Chapters.xrobot_platform_esp32,
287-
collapsed: true,
288-
items: [
289-
{ text: "esp32-s3", link: "S3" },
290-
{ text: "esp32-c3", link: "C3" },
291-
].map((item) => apply_prefix(item, Chapters.xrobot_platform_esp32)),
292-
},
293-
];
294-
295-
const items_xrobot_platform_others = [
296-
{
297-
text: "厂商接入指南",
298-
link: Chapters.xrobot_platform_others,
299-
collapsed: true,
300-
items: [
301-
...items_xrobot_platform_device,
302-
...items_xrobot_platform_mp,
303-
...items_xrobot_platform_console,
304-
],
305-
},
306-
];
307-
308-
const items_xrobot_platform = [
309-
{
310-
text: "最佳实践",
311-
link: Chapters.xrobot_platform,
312-
// collapsed: false,
313-
items: [...items_xrobot_platform_esp32, ...items_xrobot_platform_others],
314-
},
315-
];
316-
317239
const items_xrobot_faq = [
318240
{
319241
text: "常见问题",
@@ -332,9 +254,10 @@ const items_xrobot = [
332254
link: Chapters.xrobot,
333255
// collapsed: false,
334256
items: [
335-
...items_xrobot_guide,
336-
...items_xrobot_api,
337257
...items_xrobot_platform,
258+
...items_xrobot_api,
259+
...items_xrobot_mcp,
260+
...items_xrobot_guide,
338261
...items_xrobot_faq,
339262
],
340263
},
@@ -351,30 +274,33 @@ function gobackItem(chapter: Chapters) {
351274
export const ChapterItems: Record<Chapters, ChapterItem[]> = {
352275
// main
353276
[Chapters.xrobot]: items_xrobot,
277+
// platform
278+
[Chapters.xrobot_platform]: [
279+
gobackItem(Chapters.xrobot),
280+
...items_xrobot_platform,
281+
],
354282
// api
355283
[Chapters.xrobot_api]: [gobackItem(Chapters.xrobot), ...items_xrobot_api],
356284
[Chapters.xrobot_api_server]: [
357285
gobackItem(Chapters.xrobot_api),
358286
...items_xrobot_api_server,
359287
],
288+
// mcp
289+
[Chapters.xrobot_mcp]: [gobackItem(Chapters.xrobot), ...items_xrobot_mcp],
360290
// [Chapters.xrobot_api_client]: [
361291
// gobackItem(Chapters.xrobot_api),
362292
// ...items_xrobot_api_client,
363293
// ],
364-
[Chapters.xrobot_api_protocol]: [
365-
gobackItem(Chapters.xrobot_api),
366-
...items_xrobot_api_protocol,
367-
],
368-
[Chapters.xrobot_api_mcp]: [
369-
gobackItem(Chapters.xrobot_api),
370-
...items_xrobot_api_mcp,
371-
],
372294
// guide
373295
[Chapters.xrobot_guide]: [gobackItem(Chapters.xrobot), ...items_xrobot_guide],
374296
[Chapters.xrobot_guide_quick_start]: [
375297
gobackItem(Chapters.xrobot),
376298
...items_xrobot_guide_quick_start,
377299
],
300+
[Chapters.xrobot_guide_quick_start_net_config]: [
301+
gobackItem(Chapters.xrobot_guide_quick_start),
302+
...items_xrobot_platform_net_config,
303+
],
378304
[Chapters.xrobot_guide_xiaozhi_firmware]: [
379305
gobackItem(Chapters.xrobot),
380306
...items_xrobot_guide_xiaozhi_firmware,
@@ -387,41 +313,6 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
387313
gobackItem(Chapters.xrobot),
388314
...items_xrobot_guide_platform_mp,
389315
],
390-
// platform
391-
[Chapters.xrobot_platform]: [
392-
gobackItem(Chapters.xrobot),
393-
...items_xrobot_platform,
394-
],
395-
// - esp32
396-
[Chapters.xrobot_platform_esp32]: [
397-
gobackItem(Chapters.xrobot_platform),
398-
...items_xrobot_platform_esp32,
399-
],
400-
// - others
401-
[Chapters.xrobot_platform_others]: [
402-
gobackItem(Chapters.xrobot_platform),
403-
...items_xrobot_platform_others,
404-
],
405-
[Chapters.xrobot_platform_others_mp]: [
406-
gobackItem(Chapters.xrobot_platform_others),
407-
...items_xrobot_platform_mp,
408-
],
409-
[Chapters.xrobot_platform_others_device]: [
410-
gobackItem(Chapters.xrobot_platform_others),
411-
...items_xrobot_platform_device,
412-
],
413-
[Chapters.xrobot_platform_others_console]: [
414-
gobackItem(Chapters.xrobot_platform_others),
415-
...items_xrobot_platform_console,
416-
],
417-
[Chapters.xrobot_platform_others_device_net_config]: [
418-
gobackItem(Chapters.xrobot_platform_others),
419-
...items_xrobot_platform_net_config,
420-
],
421-
[Chapters.xrobot_platform_others_device_device_bind]: [
422-
gobackItem(Chapters.xrobot_platform_others),
423-
...items_xrobot_platform_device_bind,
424-
],
425316
// platform - others END
426317
// faq
427318
[Chapters.xrobot_faq]: [gobackItem(Chapters.xrobot), ...items_xrobot_faq],

0 commit comments

Comments
 (0)