create-rspress 2.0.12 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/dist/index.js +33 -14
- package/package.json +6 -6
- package/template-basic/docs/_nav.json +16 -0
- package/template-basic/docs/api/_meta.json +1 -0
- package/template-basic/docs/api/commands.mdx +7 -0
- package/template-basic/docs/api/index.mdx +6 -0
- package/template-basic/docs/guide/_meta.json +12 -0
- package/template-basic/docs/guide/start/_meta.json +1 -0
- package/template-basic/docs/guide/start/getting-started.md +51 -0
- package/template-basic/docs/guide/start/introduction.md +15 -0
- package/template-basic/docs/guide/use-mdx/_meta.json +1 -0
- package/template-basic/docs/guide/use-mdx/code-blocks/_meta.json +1 -0
- package/template-basic/docs/guide/use-mdx/code-blocks/index.mdx +9 -0
- package/template-basic/docs/guide/use-mdx/code-blocks/meta.md +7 -0
- package/template-basic/docs/guide/use-mdx/code-blocks/title.md +5 -0
- package/template-basic/docs/guide/use-mdx/components.mdx +47 -0
- package/template-basic/docs/guide/use-mdx/container.md +33 -0
- package/template-basic/docs/index.md +43 -0
- package/template-basic-theme/theme/index.css +12 -0
- package/template-basic-theme/theme/index.tsx +4 -0
- package/template-common/package.json +2 -2
- package/template-common/rspress.config.ts +1 -0
- package/template-i18n/docs/en/_nav.json +16 -0
- package/template-i18n/docs/en/api/_meta.json +1 -0
- package/template-i18n/docs/en/api/commands.mdx +11 -0
- package/template-i18n/docs/en/api/index.mdx +7 -0
- package/template-i18n/docs/en/guide/_meta.json +12 -0
- package/template-i18n/docs/en/guide/start/_meta.json +1 -0
- package/template-i18n/docs/en/guide/start/getting-started.md +55 -0
- package/template-i18n/docs/en/guide/start/introduction.md +19 -0
- package/template-i18n/docs/en/guide/use-mdx/_meta.json +1 -0
- package/template-i18n/docs/en/guide/use-mdx/code-blocks/_meta.json +1 -0
- package/template-i18n/docs/en/guide/use-mdx/code-blocks/index.mdx +13 -0
- package/template-i18n/docs/en/guide/use-mdx/code-blocks/meta.md +11 -0
- package/template-i18n/docs/en/guide/use-mdx/code-blocks/title.md +9 -0
- package/template-i18n/docs/en/guide/use-mdx/components.mdx +51 -0
- package/template-i18n/docs/en/guide/use-mdx/container.md +37 -0
- package/template-i18n/docs/en/index.md +44 -0
- package/template-i18n/docs/zh/_nav.json +16 -0
- package/template-i18n/docs/zh/api/_meta.json +12 -0
- package/template-i18n/docs/zh/api/commands.mdx +11 -0
- package/template-i18n/docs/zh/api/index.mdx +7 -0
- package/template-i18n/docs/zh/guide/_meta.json +12 -0
- package/template-i18n/docs/zh/guide/start/_meta.json +12 -0
- package/template-i18n/docs/zh/guide/start/getting-started.md +55 -0
- package/template-i18n/docs/zh/guide/start/introduction.md +19 -0
- package/template-i18n/docs/zh/guide/use-mdx/_meta.json +17 -0
- package/template-i18n/docs/zh/guide/use-mdx/code-blocks/_meta.json +12 -0
- package/template-i18n/docs/zh/guide/use-mdx/code-blocks/index.mdx +13 -0
- package/template-i18n/docs/zh/guide/use-mdx/code-blocks/meta.md +11 -0
- package/template-i18n/docs/zh/guide/use-mdx/code-blocks/title.md +9 -0
- package/template-i18n/docs/zh/guide/use-mdx/components.mdx +51 -0
- package/template-i18n/docs/zh/guide/use-mdx/container.md +37 -0
- package/template-i18n/docs/zh/index.md +44 -0
- package/template-i18n/rspress.config.ts +37 -0
- package/template-i18n-theme/docs/en/_nav.json +16 -0
- package/template-i18n-theme/docs/en/api/_meta.json +1 -0
- package/template-i18n-theme/docs/en/api/commands.mdx +11 -0
- package/template-i18n-theme/docs/en/api/index.mdx +7 -0
- package/template-i18n-theme/docs/en/guide/_meta.json +12 -0
- package/template-i18n-theme/docs/en/guide/start/_meta.json +1 -0
- package/template-i18n-theme/docs/en/guide/start/getting-started.md +55 -0
- package/template-i18n-theme/docs/en/guide/start/introduction.md +19 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/_meta.json +1 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/_meta.json +1 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/index.mdx +13 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/meta.md +11 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/title.md +9 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/components.mdx +51 -0
- package/template-i18n-theme/docs/en/guide/use-mdx/container.md +37 -0
- package/template-i18n-theme/docs/en/index.md +44 -0
- package/template-i18n-theme/docs/zh/_nav.json +16 -0
- package/template-i18n-theme/docs/zh/api/_meta.json +12 -0
- package/template-i18n-theme/docs/zh/api/commands.mdx +11 -0
- package/template-i18n-theme/docs/zh/api/index.mdx +7 -0
- package/template-i18n-theme/docs/zh/guide/_meta.json +12 -0
- package/template-i18n-theme/docs/zh/guide/start/_meta.json +12 -0
- package/template-i18n-theme/docs/zh/guide/start/getting-started.md +55 -0
- package/template-i18n-theme/docs/zh/guide/start/introduction.md +19 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/_meta.json +17 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/_meta.json +12 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/index.mdx +13 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/meta.md +11 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/title.md +9 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/components.mdx +51 -0
- package/template-i18n-theme/docs/zh/guide/use-mdx/container.md +37 -0
- package/template-i18n-theme/docs/zh/index.md +44 -0
- package/template-i18n-theme/rspress.config.ts +37 -0
- package/template-i18n-theme/theme/env.d.ts +9 -0
- package/template-i18n-theme/theme/index.css +12 -0
- package/template-i18n-theme/theme/index.tsx +4 -0
- package/template-basic/template-placeholder +0 -1
- package/template-custom-theme/theme/index.css +0 -6
- package/template-custom-theme/theme/index.tsx +0 -3
- /package/{template-common → template-basic-theme}/docs/_nav.json +0 -0
- /package/{template-common → template-basic-theme}/docs/api/_meta.json +0 -0
- /package/{template-common → template-basic-theme}/docs/api/commands.mdx +0 -0
- /package/{template-common → template-basic-theme}/docs/api/index.mdx +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/_meta.json +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/start/_meta.json +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/start/getting-started.md +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/start/introduction.md +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/_meta.json +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/_meta.json +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/index.mdx +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/meta.md +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/title.md +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/components.mdx +0 -0
- /package/{template-common → template-basic-theme}/docs/guide/use-mdx/container.md +0 -0
- /package/{template-common → template-basic-theme}/docs/index.md +0 -0
- /package/{template-custom-theme → template-basic-theme}/theme/env.d.ts +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use Markdown, MDX, React components, and Rspress built-in components in documentation pages.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# MDX & React components
|
|
6
|
+
|
|
7
|
+
Rspress supports not only Markdown but also [MDX](https://mdxjs.com/), a powerful way to develop content.
|
|
8
|
+
|
|
9
|
+
## Markdown
|
|
10
|
+
|
|
11
|
+
MDX is a superset of Markdown, which means you can write Markdown files as usual. For example:
|
|
12
|
+
|
|
13
|
+
```md
|
|
14
|
+
# Hello world
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Use components
|
|
18
|
+
|
|
19
|
+
When you want to use React components in Markdown files, you should name your files with `.mdx` extension.
|
|
20
|
+
|
|
21
|
+
```mdx
|
|
22
|
+
// docs/index.mdx
|
|
23
|
+
import { CustomComponent } from './custom';
|
|
24
|
+
|
|
25
|
+
# Hello world
|
|
26
|
+
|
|
27
|
+
<CustomComponent />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Use Rspress built-in components
|
|
31
|
+
|
|
32
|
+
import { Tabs, Tab } from '@rspress/core/theme';
|
|
33
|
+
|
|
34
|
+
<Tabs>
|
|
35
|
+
|
|
36
|
+
<Tab label="foo.js">
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
console.log('foo');
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
</Tab>
|
|
43
|
+
<Tab label="bar.js">
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
console.log('bar');
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</Tab>
|
|
50
|
+
|
|
51
|
+
</Tabs>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create Rspress custom containers for tips, info, warnings, dangers, details, and custom titles.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Container
|
|
6
|
+
|
|
7
|
+
You can use the `:::` syntax to create custom containers and support custom titles.
|
|
8
|
+
|
|
9
|
+
## Examples
|
|
10
|
+
|
|
11
|
+
:::tip
|
|
12
|
+
This is a `block` of type `tip`
|
|
13
|
+
:::
|
|
14
|
+
|
|
15
|
+
:::info
|
|
16
|
+
This is a `block` of type `info`
|
|
17
|
+
:::
|
|
18
|
+
|
|
19
|
+
:::warning
|
|
20
|
+
This is a `block` of type `warning`
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
:::danger
|
|
24
|
+
This is a `block` of type `danger`
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
::: details
|
|
28
|
+
This is a `block` of type `details`
|
|
29
|
+
:::
|
|
30
|
+
|
|
31
|
+
:::tip Custom Title
|
|
32
|
+
This is a `block` of `Custom Title`
|
|
33
|
+
:::
|
|
34
|
+
|
|
35
|
+
:::tip{title="Custom Title"}
|
|
36
|
+
This is a `block` of `Custom Title`
|
|
37
|
+
:::
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rspress starter homepage with guide, MDX, search, AI, SSG, and theme customization links.
|
|
3
|
+
pageType: home
|
|
4
|
+
|
|
5
|
+
hero:
|
|
6
|
+
name: My Site
|
|
7
|
+
text: A cool website!
|
|
8
|
+
tagline: This is the tagline
|
|
9
|
+
actions:
|
|
10
|
+
- theme: brand
|
|
11
|
+
text: Quick Start
|
|
12
|
+
link: /guide/start/introduction
|
|
13
|
+
- theme: alt
|
|
14
|
+
text: GitHub
|
|
15
|
+
link: https://github.com/web-infra-dev/rspress
|
|
16
|
+
image:
|
|
17
|
+
src: /rspress-icon.png
|
|
18
|
+
alt: Logo
|
|
19
|
+
features:
|
|
20
|
+
- title: Blazing fast build speed
|
|
21
|
+
details: The core compilation module is based on the Rust front-end toolchain, providing a more ultimate development experience.
|
|
22
|
+
icon: 🏃🏻♀️
|
|
23
|
+
link: /guide/start/introduction
|
|
24
|
+
- title: Support for MDX content writing
|
|
25
|
+
details: MDX is a powerful way to write content, allowing you to use React components in Markdown.
|
|
26
|
+
icon: 📦
|
|
27
|
+
link: /guide/use-mdx/components
|
|
28
|
+
- title: Built-in full-text search
|
|
29
|
+
details: Automatically generates a full-text search index for you during construction, providing out-of-the-box full-text search capabilities.
|
|
30
|
+
icon: 🎨
|
|
31
|
+
link: https://rspress.rs/guide/advanced/custom-search
|
|
32
|
+
- title: AI-friendly
|
|
33
|
+
details: Generate llms.txt and Markdown files compliant with the llms.txt specification through SSG-MD, making it easier for large language models to understand and use your documentation.
|
|
34
|
+
icon: 🤖
|
|
35
|
+
link: https://rspress.rs/guide/basic/ssg-md
|
|
36
|
+
- title: Static site generation
|
|
37
|
+
details: In production, it automatically builds into static HTML files, which can be easily deployed anywhere.
|
|
38
|
+
icon: 🌈
|
|
39
|
+
link: https://rspress.rs/guide/basic/ssg
|
|
40
|
+
- title: Providing multiple custom capabilities
|
|
41
|
+
details: Through its extension mechanism, you can easily extend theme UI and build process.
|
|
42
|
+
icon: 🔥
|
|
43
|
+
link: https://rspress.rs/guide/basic/custom-theme
|
|
44
|
+
---
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 了解 Rspress 项目结构、本地开发、生产构建、本地预览和后续学习路径。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 快速开始
|
|
6
|
+
|
|
7
|
+
## 项目结构
|
|
8
|
+
|
|
9
|
+
使用 `create-rspress` 创建项目后,你会得到以下项目结构:
|
|
10
|
+
|
|
11
|
+
- `docs/`:文档源码目录,通过 `rspress.config.ts` 中的 `root` 配置。
|
|
12
|
+
- `docs/_nav.json`:导航栏配置。
|
|
13
|
+
- `docs/guide/_meta.json`:指南区域的侧边栏配置。
|
|
14
|
+
- `docs/public/`:静态资源目录。
|
|
15
|
+
- `theme/`:可选的自定义主题目录,在选择自定义主题模板时生成。
|
|
16
|
+
- `rspress.config.ts`:Rspress 配置文件。
|
|
17
|
+
|
|
18
|
+
## 本地开发
|
|
19
|
+
|
|
20
|
+
启动本地开发服务器:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
:::tip
|
|
27
|
+
|
|
28
|
+
你可以使用 `--port` 或 `--host` 指定端口号或主机,例如 `rspress dev --port 8080 --host 0.0.0.0`。
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## 生产构建
|
|
33
|
+
|
|
34
|
+
构建生产站点:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
默认情况下,Rspress 会输出到 `doc_build` 目录。
|
|
41
|
+
|
|
42
|
+
## 预览
|
|
43
|
+
|
|
44
|
+
本地预览生产构建结果:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm run preview
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 下一步
|
|
51
|
+
|
|
52
|
+
- 学习如何在文档中使用 [MDX 与 React 组件](/guide/use-mdx/components)。
|
|
53
|
+
- 了解 [代码块](/guide/use-mdx/code-blocks/) 的语法高亮和行高亮。
|
|
54
|
+
- 学习用于提示、警告等内容的 [自定义容器](/guide/use-mdx/container)。
|
|
55
|
+
- 浏览完整的 [Rspress 文档](https://rspress.rs/zh/) 了解高级能力。
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 介绍 Rspress 的构建性能、AI 原生输出、MDX 支持、基础能力和扩展机制。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 介绍
|
|
6
|
+
|
|
7
|
+
Rspress 是一个基于 [Rsbuild](https://rsbuild.rs/) 的静态站点生成器,使用 React 框架渲染。它内置默认文档主题,你可以用 Rspress 快速构建文档站点。
|
|
8
|
+
|
|
9
|
+
## 为什么选择 Rspress
|
|
10
|
+
|
|
11
|
+
- **构建性能**。核心编译模块基于 Rust 前端工具链,提供毫秒级启动和更极致的开发体验。
|
|
12
|
+
- **AI 原生**。技术文档不仅服务人类读者,也可以通过 SSG-MD 更好地被 AI 理解和使用。
|
|
13
|
+
- **MDX 支持**。MDX 是一种强大的内容编写方式,可以在 Markdown 中使用 React 组件。
|
|
14
|
+
- **基础能力**。包括全文搜索、国际化、多版本支持、组件库文档等。
|
|
15
|
+
- **可扩展性**。提供内置插件系统,支持通过插件 API 扩展 Rspress。
|
|
16
|
+
|
|
17
|
+
## 试用 Rspress
|
|
18
|
+
|
|
19
|
+
前往 [快速开始](/guide/start/getting-started) 了解如何使用 Rspress 构建文档站点。
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 使用 Shiki 为 Rspress 代码块配置语法高亮和自动语言处理。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 代码块
|
|
6
|
+
|
|
7
|
+
Rspress 使用 [Shiki](https://shiki.style) 在编译时进行语法高亮,这意味着运行时性能更好。
|
|
8
|
+
|
|
9
|
+
使用多种语言的代码块时,对应语言会在编译时自动检测,运行时包体积不会增加。支持的编程语言请参考 [Shiki 支持语言列表](https://shiki.style/languages)。
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
console.log('Hello World');
|
|
13
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 在文档页面中使用 Markdown、MDX、React 组件和 Rspress 内置组件。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# MDX 与 React 组件
|
|
6
|
+
|
|
7
|
+
Rspress 不仅支持 Markdown,还支持 [MDX](https://mdxjs.com/),这是一种强大的内容开发方式。
|
|
8
|
+
|
|
9
|
+
## Markdown
|
|
10
|
+
|
|
11
|
+
MDX 是 Markdown 的超集,这意味着你可以像往常一样编写 Markdown 文件。例如:
|
|
12
|
+
|
|
13
|
+
```md
|
|
14
|
+
# Hello world
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 使用组件
|
|
18
|
+
|
|
19
|
+
当你想在 Markdown 文件中使用 React 组件时,应该使用 `.mdx` 扩展名命名文件。
|
|
20
|
+
|
|
21
|
+
```mdx
|
|
22
|
+
// docs/index.mdx
|
|
23
|
+
import { CustomComponent } from './custom';
|
|
24
|
+
|
|
25
|
+
# Hello world
|
|
26
|
+
|
|
27
|
+
<CustomComponent />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 使用 Rspress 内置组件
|
|
31
|
+
|
|
32
|
+
import { Tabs, Tab } from '@rspress/core/theme';
|
|
33
|
+
|
|
34
|
+
<Tabs>
|
|
35
|
+
|
|
36
|
+
<Tab label="foo.js">
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
console.log('foo');
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
</Tab>
|
|
43
|
+
<Tab label="bar.js">
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
console.log('bar');
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</Tab>
|
|
50
|
+
|
|
51
|
+
</Tabs>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 创建 Rspress 自定义容器,用于提示、信息、警告、危险、详情和自定义标题。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 容器
|
|
6
|
+
|
|
7
|
+
你可以使用 `:::` 语法创建自定义容器,并支持自定义标题。
|
|
8
|
+
|
|
9
|
+
## 示例
|
|
10
|
+
|
|
11
|
+
:::tip
|
|
12
|
+
这是一个 `tip` 类型的 `block`
|
|
13
|
+
:::
|
|
14
|
+
|
|
15
|
+
:::info
|
|
16
|
+
这是一个 `info` 类型的 `block`
|
|
17
|
+
:::
|
|
18
|
+
|
|
19
|
+
:::warning
|
|
20
|
+
这是一个 `warning` 类型的 `block`
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
:::danger
|
|
24
|
+
这是一个 `danger` 类型的 `block`
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
::: details
|
|
28
|
+
这是一个 `details` 类型的 `block`
|
|
29
|
+
:::
|
|
30
|
+
|
|
31
|
+
:::tip Custom Title
|
|
32
|
+
这是一个 `Custom Title` 的 `block`
|
|
33
|
+
:::
|
|
34
|
+
|
|
35
|
+
:::tip{title="Custom Title"}
|
|
36
|
+
这是一个 `Custom Title` 的 `block`
|
|
37
|
+
:::
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rspress 入门模板首页,包含指南、MDX、搜索、AI、SSG 和主题定制入口。
|
|
3
|
+
pageType: home
|
|
4
|
+
|
|
5
|
+
hero:
|
|
6
|
+
name: 我的站点
|
|
7
|
+
text: 一个很酷的网站!
|
|
8
|
+
tagline: 这是网站的副标题
|
|
9
|
+
actions:
|
|
10
|
+
- theme: brand
|
|
11
|
+
text: 快速开始
|
|
12
|
+
link: /zh/guide/start/introduction
|
|
13
|
+
- theme: alt
|
|
14
|
+
text: GitHub
|
|
15
|
+
link: https://github.com/web-infra-dev/rspress
|
|
16
|
+
image:
|
|
17
|
+
src: /rspress-icon.png
|
|
18
|
+
alt: Logo
|
|
19
|
+
features:
|
|
20
|
+
- title: 极速构建
|
|
21
|
+
details: 核心编译模块基于 Rust 前端工具链,提供更极致的开发体验。
|
|
22
|
+
icon: 🏃🏻♀️
|
|
23
|
+
link: /zh/guide/start/introduction
|
|
24
|
+
- title: 支持 MDX 内容编写
|
|
25
|
+
details: MDX 是一种强大的内容编写方式,可以在 Markdown 中使用 React 组件。
|
|
26
|
+
icon: 📦
|
|
27
|
+
link: /zh/guide/use-mdx/components
|
|
28
|
+
- title: 内置全文搜索
|
|
29
|
+
details: 构建时自动生成全文搜索索引,提供开箱即用的全文搜索能力。
|
|
30
|
+
icon: 🎨
|
|
31
|
+
link: https://rspress.rs/zh/guide/advanced/custom-search
|
|
32
|
+
- title: AI 友好
|
|
33
|
+
details: 通过 SSG-MD 生成符合 llms.txt 规范的 llms.txt 和 Markdown 文件,让大语言模型更容易理解和使用你的文档。
|
|
34
|
+
icon: 🤖
|
|
35
|
+
link: https://rspress.rs/zh/guide/basic/ssg-md
|
|
36
|
+
- title: 静态站点生成
|
|
37
|
+
details: 在生产环境中自动构建为静态 HTML 文件,可以轻松部署到任意位置。
|
|
38
|
+
icon: 🌈
|
|
39
|
+
link: https://rspress.rs/zh/guide/basic/ssg
|
|
40
|
+
- title: 提供多种自定义能力
|
|
41
|
+
details: 通过扩展机制,你可以轻松扩展主题 UI 和构建流程。
|
|
42
|
+
icon: 🔥
|
|
43
|
+
link: https://rspress.rs/zh/guide/basic/custom-theme
|
|
44
|
+
---
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { defineConfig } from '@rspress/core';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
root: path.join(__dirname, 'docs'),
|
|
6
|
+
title: 'My Site',
|
|
7
|
+
description: 'A multilingual Rspress documentation site.',
|
|
8
|
+
lang: 'en',
|
|
9
|
+
icon: '/rspress-icon.png',
|
|
10
|
+
logo: {
|
|
11
|
+
light: '/rspress-light-logo.png',
|
|
12
|
+
dark: '/rspress-dark-logo.png',
|
|
13
|
+
},
|
|
14
|
+
locales: [
|
|
15
|
+
{
|
|
16
|
+
lang: 'en',
|
|
17
|
+
label: 'English',
|
|
18
|
+
title: 'My Site',
|
|
19
|
+
description: 'A multilingual Rspress documentation site.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
lang: 'zh',
|
|
23
|
+
label: '简体中文',
|
|
24
|
+
title: '我的站点',
|
|
25
|
+
description: '一个多语言 Rspress 文档站点。',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
themeConfig: {
|
|
29
|
+
socialLinks: [
|
|
30
|
+
{
|
|
31
|
+
icon: 'github',
|
|
32
|
+
mode: 'link',
|
|
33
|
+
content: 'https://github.com/web-infra-dev/rspress',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["index", "commands"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["introduction", "getting-started"]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Set up an Rspress project, run local development, build production output, and choose next docs topics.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Getting started
|
|
6
|
+
|
|
7
|
+
## Project structure
|
|
8
|
+
|
|
9
|
+
After creating a project with `create-rspress`, you will get the following project structure:
|
|
10
|
+
|
|
11
|
+
- `docs/` — The documentation source directory, configured via `root` in `rspress.config.ts`.
|
|
12
|
+
- `docs/_nav.json` — The navigation bar configuration.
|
|
13
|
+
- `docs/guide/_meta.json` — The sidebar configuration for the guide section.
|
|
14
|
+
- `docs/public/` — Static assets directory.
|
|
15
|
+
- `theme/` — Optional custom theme directory, generated when you choose the custom theme scaffold.
|
|
16
|
+
- `rspress.config.ts` — The Rspress configuration file.
|
|
17
|
+
|
|
18
|
+
## Development
|
|
19
|
+
|
|
20
|
+
Start the local development server:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
:::tip
|
|
27
|
+
|
|
28
|
+
You can specify the port number or host with `--port` or `--host`, such as `rspress dev --port 8080 --host 0.0.0.0`.
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Production build
|
|
33
|
+
|
|
34
|
+
Build the site for production:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
By default, Rspress will output to `doc_build` directory.
|
|
41
|
+
|
|
42
|
+
## Preview
|
|
43
|
+
|
|
44
|
+
Preview the production build locally:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm run preview
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Next steps
|
|
51
|
+
|
|
52
|
+
- Learn how to use [MDX & React Components](/guide/use-mdx/components) in your docs.
|
|
53
|
+
- Learn about [Code Blocks](/guide/use-mdx/code-blocks/) syntax highlighting and line highlighting.
|
|
54
|
+
- Learn about [Custom Containers](/guide/use-mdx/container) for tips, warnings, and more.
|
|
55
|
+
- Explore the full [Rspress documentation](https://rspress.rs/) for advanced features.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Introduction to Rspress features, including build performance, AI-native output, MDX, and extensibility.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Introduction
|
|
6
|
+
|
|
7
|
+
Rspress is a static site generator based on [Rsbuild](https://rsbuild.rs/), rendered with the React framework. It comes with a default documentation theme, and you can quickly build a documentation site with Rspress.
|
|
8
|
+
|
|
9
|
+
## Why Rspress
|
|
10
|
+
|
|
11
|
+
- **Build Performance**. The core compilation module is based on the Rust front-end toolchain, providing millisecond-level startup and a more ultimate development experience.
|
|
12
|
+
- **AI-native**. Technical documentation not only serves human readers but can also be better understood and utilized by AI through SSG-MD.
|
|
13
|
+
- **MDX Support**. MDX is a powerful way to write content, allowing you to use React components in Markdown.
|
|
14
|
+
- **Basic Capabilities**. Including full-text search, internationalization, multi-version support, component library documentation, etc.
|
|
15
|
+
- **Extensibility**. Provides a built-in plugin system, supports extending Rspress through plugin API.
|
|
16
|
+
|
|
17
|
+
## Try Rspress
|
|
18
|
+
|
|
19
|
+
Go to [Getting Started](/guide/start/getting-started) to learn how to use Rspress to build a documentation site.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["components", { "type": "dir", "name": "code-blocks" }, "container"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["title", "meta"]
|