Skip to content

Commit 9739846

Browse files
committed
feat: Upgrade Fumadocs/Next deps and refine docs/UI
- Bump fumadocs, next, react, lucide and tooling versions - Add responsive sizes to doc icons and minor layout/style tweaks - Comment out animations CSS import - Improve MDX formatting, code block titles, and content updates
1 parent f2866ba commit 9739846

File tree

10 files changed

+706
-897
lines changed

10 files changed

+706
-897
lines changed

app/docs/layout.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { source } from '@/lib/source';
55
import { BookMarked, Boxes, Hammer } from 'lucide-react';
66

77
const iconMap = {
8-
'Boxes': <Boxes />,
9-
'Hammer': <Hammer />,
10-
}
8+
Boxes: <Boxes className="size-9 md:size-5" />,
9+
Hammer: <Hammer className="size-9 md:size-5" />,
10+
};
1111

1212
function Icon({ icon }: { icon: string | undefined }) {
1313
if (!icon) return <BookMarked />;
@@ -30,12 +30,8 @@ const docsOptions: DocsLayoutProps = {
3030
},
3131
},
3232
},
33-
}
33+
};
3434

3535
export default function Layout({ children }: { children: ReactNode }) {
36-
return (
37-
<DocsLayout {...docsOptions}>
38-
{children}
39-
</DocsLayout>
40-
);
36+
return <DocsLayout {...docsOptions}>{children}</DocsLayout>;
4137
}

app/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import 'tailwindcss';
2-
@import 'fumadocs-ui/css/animations.css';
2+
/*@import 'fumadocs-ui/css/animations.css';*/
33
@import 'fumadocs-ui/css/shiki.css';
44
@import 'fumadocs-ui/css/catppuccin.css';
55
@import 'fumadocs-ui/css/preset.css';

content/docs/development/index.mdx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ import {
2121

2222
<Callout type="info" icon={<Info className="h-4 w-4" />}>
2323
sithra-rs 是一个基于 Rust
24-
的现代化、高性能、可扩展的机器人框架。通过本指南,您将学习如何开发自己的插件来扩展框架功能。
24+
的现代化、高性能、可扩展的机器人框架。
25+
26+
通过本指南,您将学习如何开发自己的插件来扩展框架功能。
27+
2528
</Callout>
2629

2730
## 开发前的准备
@@ -52,9 +55,13 @@ import {
5255
</Cards>
5356

5457
<Callout type="info" icon={<BookOpen className="h-4 w-4" />}>
55-
不用担心!即使您是 Rust
58+
不用担心!
59+
60+
即使您是 Rust
5661
新手,只要掌握基础语法和异步编程概念,就可以开始开发插件了。
62+
5763
我们提供了详细的示例代码和文档来帮助您快速上手。
64+
5865
</Callout>
5966

6067
## 插件系统概述
@@ -125,7 +132,7 @@ cd my-plugin
125132

126133
编辑 `Cargo.toml` 文件,添加必要的依赖:
127134

128-
```toml
135+
```toml title="Cargo.toml"
129136
[package]
130137
name = "my-plugin"
131138
version = "0.1.0"
@@ -155,7 +162,7 @@ anyhow = "1.0"
155162

156163
编辑 `src/main.rs` 文件,实现您的插件逻辑。以下是一个简单的 Echo 插件示例:
157164

158-
```rust
165+
```rust title="src/main.rs"
159166
use sithra_kit::{
160167
plugin::Plugin,
161168
server::extract::payload::Payload,
@@ -299,7 +306,7 @@ cd my-custom-plugin
299306

300307
编辑插件的 `Cargo.toml`,确保引用了正确的依赖:
301308

302-
```toml
309+
```toml title="Cargo.toml"
303310
[package]
304311
name = "my-custom-plugin"
305312
version = "0.1.0"
@@ -343,7 +350,7 @@ nvim config.toml
343350

344351
3. 在配置文件中添加您的插件:
345352

346-
```toml
353+
```toml title="config.toml"
347354
[my-custom-plugin]
348355
path = "./target/debug/my-custom-plugin"
349356
```
@@ -370,7 +377,9 @@ just run
370377

371378
<Cards>
372379
<Card title="日志输出">
373-
使用 <code>log::debug!</code>, <code>log::info!</code> 等宏在关键位置添加日志,帮助跟踪插件运行状态
380+
使用 `log::debug!`, `log::info!`
381+
382+
等宏在关键位置添加日志,帮助跟踪插件运行状态
374383
</Card>
375384

376385
<Card title="单元测试">为插件逻辑编写单元测试,确保各个函数按预期工作</Card>

0 commit comments

Comments
 (0)