Skip to content

Commit 7931e9c

Browse files
committed
docs: fixed typography issues
1 parent 2c5e464 commit 7931e9c

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

content/docs/development/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ cargo build --release
223223

224224
编译后的插件文件位于 `target/release` 目录。您可以将此二进制文件复制到 sithra-rs 的插件目录中使用。
225225

226-
<Callout type="info" icon={<Zap className="h-4 w-4" />}>
226+
<Callout type="info" icon={<Zap />}>
227227
编译为 release 模式会大幅提高插件性能,但编译时间较长。开发过程中可使用 <code>cargo build</code> 进行快速编译测试。
228228
</Callout>
229229
</Step>
@@ -379,7 +379,7 @@ just run
379379
</Card>
380380
</Cards>
381381

382-
<Callout type="info" icon={<Terminal className="h-4 w-4" />}>
382+
<Callout type="info" icon={<Terminal />}>
383383
在开发模式下,可以使用 <code>RUST_LOG=debug just run</code> 命令启动
384384
sithra-rs,以显示更详细的调试信息。
385385
</Callout>
@@ -393,7 +393,7 @@ just run
393393
3. 探索[适配器开发](/docs/development/adapters)以支持更多平台
394394
4. 加入我们的[QQ 群聊: 948180922](https://qm.qq.com/q/8XYQrdOPGU)分享您的创意和问题
395395

396-
<Callout type="info">
396+
<Callout>
397397
我们期待看到您创建的精彩插件!如果您开发了有用的插件,欢迎提交 Pull Request
398398
贡献给社区。
399399
</Callout>

content/docs/development/initialize.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import { Card, Cards } from "fumadocs-ui/components/card";
99
import { Steps, Step } from "fumadocs-ui/components/steps";
1010
import { Bot, Code, Puzzle, ArrowDown, Terminal, Workflow, Layers, Database } from "lucide-react";
1111

12-
<Callout type="info" icon={<Bot className="h-4 w-4" />}>
13-
### 前情提要
12+
<Callout type="info" icon={<Bot />}>
13+
14+
### 前情提要
1415

1516
我们在 [快速入门](/docs/development#实现插件逻辑) 中已经介绍了一个插件的基本结构,
1617
其中就包含了初始化插件的代码。接下来我们将以循序渐进的方式快速讲解插件初始化的具体知识点。
@@ -109,7 +110,7 @@ tokio::select! {
109110
}
110111
```
111112

112-
<Callout type="warn" icon={<Terminal className="h-4 w-4" />}>
113+
<Callout type="warn" icon={<Terminal />}>
113114

114115
当插件退出时,框架内部会直接丢弃插件实例,析构时插件会被 kill。
115116

@@ -219,7 +220,7 @@ where
219220
}
220221
```
221222

222-
<Callout type="info" icon={<Database className="h-4 w-4" />}>
223+
<Callout type="info" icon={<Database />}>
223224

224225
初始化过程的关键步骤:
225226

content/docs/development/standards.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Folder, File, Files } from 'fumadocs-ui/components/files';
99
import { Card, Cards } from 'fumadocs-ui/components/card';
1010
import { FileCode, Zap, Package, AlertTriangle, CheckCircle, BookOpen, Info, Shield } from 'lucide-react';
1111

12-
<Callout type="info" icon={<Info className="h-4 w-4" />}>
12+
<Callout>
1313
本指南定义了开发 sithra-rs 插件时应遵循的最佳实践和标准。遵循这些规范将有助于确保您的插件稳定可靠,并与 sithra-rs 生态系统和谐共存。
1414
</Callout>
1515

@@ -36,7 +36,7 @@ log::debug!("调试信息: {:?}", data);
3636
log::warn!("配置项 {} 已弃用,请使用 {}", old_config, new_config);
3737
```
3838

39-
<Callout type="warn" icon={<AlertTriangle className="h-4 w-4" />}>
39+
<Callout type="warn" icon={<AlertTriangle />}>
4040
### 禁止使用标准输出
4141

4242
由于插件使用标准输入输出(stdio)与 sithra-rs 通信,请**绝对不要**使用以下方式输出信息:
@@ -126,7 +126,7 @@ match api_call().await {
126126
}
127127
```
128128

129-
<Callout type="warn" icon={<AlertTriangle className="h-4 w-4" />}>
129+
<Callout type="warn" icon={<AlertTriangle />}>
130130
### 避免使用 unwrap 和 expect
131131

132132
`unwrap()``expect()` 在遇到 `None``Err` 时会导致程序 panic:
@@ -147,7 +147,7 @@ let result = api_call().await.expect("API调用失败");
147147

148148
</Callout>
149149

150-
<Callout type="info" icon={<Info className="h-4 w-4" />}>
150+
<Callout type="info" icon={<Info />}>
151151
### 推荐的错误处理库
152152

153153
- **anyhow**: 适用于应用程序的通用错误处理
@@ -229,7 +229,7 @@ let result = api_call().await.expect("API调用失败");
229229
</Tab>
230230
</Tabs>
231231

232-
<Callout type="info" icon={<BookOpen className="h-4 w-4" />}>
232+
<Callout type="info" icon={<BookOpen />}>
233233
服务型插件需要明确区分公共接口和内部实现:
234234

235235
- `lib.rs` 中定义其他插件可以调用的类型和接口
@@ -279,7 +279,7 @@ let result = api_call().await.expect("API调用失败");
279279

280280
### 服务型插件版本控制
281281

282-
<Callout type="warn" icon={<Shield className="h-4 w-4" />}>
282+
<Callout type="warn" icon={<Shield />}>
283283
### 服务型插件的严格版本控制
284284

285285
由于服务型插件定义了插件间通信的接口,版本控制尤为重要:
@@ -402,7 +402,7 @@ version = "1.2.3" # 主版本.次版本.修订号
402402

403403
</Card>
404404

405-
<Callout type="warn" icon={<AlertTriangle className="h-4 w-4" />}>
405+
<Callout type="warn" icon={<AlertTriangle />}>
406406
### 注意插件权限
407407

408408
sithra-rs 插件运行时具有与主程序相同的系统权限。开发者有责任确保插件:

0 commit comments

Comments
 (0)