Skip to content

Commit 5d394d4

Browse files
CopilotSoonIter
andauthored
docs: Split runtime hook docs into dedicated UI hook pages (#2885)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SoonIter <79413249+SoonIter@users.noreply.github.com> Co-authored-by: SoonIter <sooniter@gmail.com>
1 parent 5634d04 commit 5d394d4

30 files changed

+279
-242
lines changed

website/docs/en/api/_meta.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,5 @@
99
"name": "config",
1010
"label": "config"
1111
},
12-
{
13-
"type": "dir",
14-
"name": "client-api",
15-
"label": "clientApi"
16-
},
1712
"commands"
1813
]

website/docs/en/api/client-api/_meta.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

website/docs/en/api/client-api/api-components.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

website/docs/en/api/client-api/api-runtime.mdx

Lines changed: 0 additions & 103 deletions
This file was deleted.

website/docs/en/plugin/official-plugins/algolia.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ new Crawler({
247247

248248
## Distinguish search results based on i18n
249249

250-
You can achieve internationalized search results by combining [Runtime API](/api/client-api/api-runtime) with `docSearchProps`.
250+
You can achieve internationalized search results by combining [Runtime API](/ui/hooks/) with `docSearchProps`.
251251

252252
Here's an example using `docSearchProps.searchParameters`:
253253

website/docs/en/plugin/system/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ Rspress is divided into two parts: **Node Side** and **Browser Runtime**. Throug
1111
- [**Markdown/MDX compilation**](/plugin/system/plugin-api#markdown)。You can add [`remark`](https://github.com/remarkjs/remark)/[`rehype`](https://github.com/rehypejs/rehype) plugins to extend the compilation ability of Markdown/MDX.
1212
- [**Add custom page**](/plugin/system/plugin-api#addpages). On the basis of Rspress's conventional routing, you can also add new routes through plugins, such as adding a `/blog` route to display a list of blogs, and the content is defined by yourself.
1313
- [**Custom build tool behavior**](/plugin/system/plugin-api#builderconfig).In Rspress plugin, you can customize the config of the underlying build tool [Rsbuild](https://rsbuild.rs), and you can also add some Rspack or Rsbuild plugins.
14-
- [**Extend page metadata**](/plugin/system/plugin-api#extendpagedata). For each page, some metadata will be calculated inside Rspress, such as `title`, `description`, etc. You can extend the calculation logic of these metadata through plugins, and pass [usePageData](/api/client-api/api-runtime.html#usepagedata) hook access.
14+
- [**Extend page metadata**](/plugin/system/plugin-api#extendpagedata). For each page, some metadata will be calculated inside Rspress, such as `title`, `description`, etc. You can extend the calculation logic of these metadata through plugins, and pass [usePageData](/ui/hooks/use-page-data) hook access.
1515
- Insert some [**custom logic**](/plugin/system/plugin-api#beforebuild/afterbuild) before and after the build process. Such as closing some event listeners after the build process ends.
1616
- [**Add global components**](/plugin/system/plugin-api#globaluicomponents). Rspress internally uses React for rendering. You can flexibly extend the runtime page by defining global React components, such as `adding a global BackToTop (return to top) component`, `adding a global side effect logic`.

website/docs/en/ui/components/package-manager-tabs.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import { PackageManagerTabs } from '@theme';
1+
---
2+
overviewHeaders: []
3+
---
4+
5+
import { PackageManagerTabs, Tag } from '@theme';
26

3-
# PackageManagerTabs
7+
# PackageManagerTabs <Tag tag="ejectable" />
48

59
PackageManagerTabs displays commands for different package managers.
610

711
## Basic usage
812

9-
```mdx preview title="index.mdx"
13+
```mdx title="index.mdx"
1014
import { PackageManagerTabs } from '@theme';
1115

1216
<PackageManagerTabs command="install -D @rspress/core" />

website/docs/en/ui/custom-theme.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export { Search, HomeLayout, NotFoundLayout };
130130
export * from '@rspress/core/theme-original';
131131
```
132132

133-
Of course, you may need to use page data during the development process, you can get it through [`Runtime API`](/api/client-api/api-runtime).
133+
Of course, you may need to use page data during the development process, you can get it through [`Runtime API`](/ui/hooks/).
134134

135135
### 4. Custom icon
136136

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
["use-i18n"]
1+
[
2+
"use-lang",
3+
"use-version",
4+
"use-dark",
5+
"router-hooks",
6+
"use-i18n",
7+
"use-page-data"
8+
]

website/docs/en/ui/hooks/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
overview: true
3+
title: Built-in hooks
4+
---

0 commit comments

Comments
 (0)