Skip to content

Commit b7fee83

Browse files
committed
update docs.
1 parent dcdda83 commit b7fee83

File tree

15 files changed

+242
-217
lines changed

15 files changed

+242
-217
lines changed

docs/en/apis/advanced-apis/event/index.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
weight: 60
3-
i18n:
4-
title:
5-
en: Event APIs
6-
sourceSHA: 8809b094c8105f8604d2ba11aadb870bba8d9c03153a5fe6faf78ae05fe72532
7-
title: Event APIs
3+
sourceSHA: 370e862f85439712afb717d92284c57404ae189d662c74dfe296ffd30e6e779a
84
---
95

106
# Event APIs

docs/en/apis/advanced-apis/event/search.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
weight: 10
3-
i18n:
4-
title:
5-
en: Search
6-
sourceSHA: 4a0c5ef180e6d30f12a222e38e3650ba6607dcb230ee913bda5155d9e116d4e9
7-
title: Search
3+
sourceSHA: fa591f45a8cca0a7d28b464ddb8879dd40e4f18183e9c5515831f03e330dbf99
84
---
95

106
# Search

docs/en/apis/advanced-apis/log/aggregation.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
weight: 10
3-
i18n:
4-
title:
5-
en: Aggregation
6-
sourceSHA: 39884ddc096a7870717b76670797eecc9f570ac73e76b50818dd2c2614b2fcba
7-
title: Aggregation
3+
sourceSHA: 1d46a290336ad1b760dcaf335f590ae2ae8267c82c82be018d2fc496ae91d410
84
---
95

106
# Aggregation

docs/en/apis/advanced-apis/log/index.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
weight: 60
3-
i18n:
4-
title:
5-
en: Log APIs
6-
sourceSHA: b78ccbd9949f70870d0959e026b530bfb367e60078efc0c9b44dc5b27c60717d
7-
title: Log APIs
3+
sourceSHA: b2b48b3333ce4a837f5474b29aa5499f1c33ba4762c2693d7e1d484c7755e640
84
---
95

106
# Log APIs

docs/en/apis/advanced-apis/log/search.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
weight: 10
3-
i18n:
4-
title:
5-
en: Search
6-
sourceSHA: 3e708205c6a8169d217363cee866bfbff51c55866ee5f3dfec1f382378d190a1
7-
title: Search
3+
sourceSHA: ae25774df3cf34163a10335353042ffad7f3ddbcbdda5574f1194fb99b837633
84
---
95

106
# Search

docs/en/start.mdx

Lines changed: 61 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
2-
sourceSHA: e31a32d16aad2cdb01d351735f58941fd13ae5e5ec7ca53922a524c102850d8f
2+
sourceSHA: c3feb38cb30b2f92c125dfa6af05ca6f5e9a23fd299bbbd39f4726159b7d7079
33
---
44

5-
# Start \{#start}
5+
# Getting Started \{#start}
66

7-
## Create Project \{#create}
7+
## Creating a Project \{#create}
88

9-
First, you can create a new directory using the following command:
9+
First, you can create a new directory with the following command:
1010

1111
```bash
1212
mkdir my-docs && cd my-docs
1313
```
1414

15-
Run `npm init -y` to initialize a project. You can use npm, yarn, or pnpm to install doom:
15+
Run `npm init -y` to initialize a project. You can install doom using npm, yarn, or pnpm:
1616

1717
<PackageManagerTabs command="install -D @alauda/doom typescript" />
1818

19-
Then, create files using the following commands:
19+
Then create files with the following commands:
2020

2121
```bash
22-
# Create docs directory, supporting both Chinese and English by default
22+
# Create docs directories, default supports bilingual Chinese and English
2323
mkdir docs/en && echo '# Hello World' > docs/en/index.md
2424
mkdir docs/zh && echo '# 你好世界' > docs/zh/index.md
2525
```
2626

27-
Add the following scripts in `package.json`:
27+
Add the following scripts to your `package.json`:
2828

2929
```json
3030
{
@@ -45,7 +45,7 @@ Then initialize a configuration file `doom.config.yml`:
4545
title: My Docs
4646
```
4747
48-
Also, create a `tsconfig.json` file with the following content:
48+
Also create a `tsconfig.json` file with the following content:
4949

5050
```jsonc
5151
{
@@ -66,15 +66,15 @@ Also, create a `tsconfig.json` file with the following content:
6666
}
6767
```
6868

69-
Lastly, create a `global.d.ts` file with the following content:
69+
Finally, create a `global.d.ts` file with the following content:
7070

7171
```ts
7272
/// <reference types="@alauda/doom/runtime" />
7373
```
7474

75-
Now you can use the global components provided by doom in your `.mdx` files with type safety.
75+
This allows you to safely use the global components provided by doom in `.mdx` files with type safety.
7676

77-
## Command Line Tool \{#cli}
77+
## CLI Tool \{#cli}
7878

7979
```bash
8080
doom -h
@@ -117,9 +117,11 @@ Commands:
117117
help [command] display help for command
118118
```
119119
120-
### Start Development Service \{#dev}
120+
For more configuration, please refer to [Configuration](./usage/configuration)
121121
122-
Run `yarn dev` to start the development service, and the browser will automatically open the documentation homepage.
122+
### Starting the Development Server \{#dev}
123+
124+
Run `yarn dev` to start the development server, the browser will automatically open the documentation homepage.
123125

124126
```sh
125127
doom dev -h
@@ -135,23 +137,23 @@ Arguments:
135137
Options:
136138
-H, --host [host] Dev server host name
137139
-P, --port [port] Dev server port number
138-
-l, --lazy [boolean] Whether to enable `lazyCompilation`, which could improve the compilation performance (default: false)
140+
-l, --lazy [boolean] Whether to enable `lazyCompilation` which could improve the compilation performance (default: false)
139141
-h, --help display help for command
140142
```
141143

142144
### Production Build \{#build}
143145

144-
Run `yarn build` to build the production environment code. After the build is completed, static files will be generated in the `dist` directory.
146+
Run `yarn build` to build the production code. After building, static files will be generated in the `dist` directory.
145147

146148
### Local Preview \{#serve}
147149

148-
Run `yarn serve` to preview the built static files. Note that if you used the `-b`, `-p` options to build, the same options are also required when previewing.
150+
Run `yarn serve` to preview the built static files. Note that if you used `-b` or `-p` parameters during build, you need to use the same `-b` and `-p` parameters during preview.
149151

150-
### Use Scaffolding Templates \{#new}
152+
### Using Scaffolding Templates \{#new}
151153

152154
Run `yarn new` to generate projects, modules, or documentation using scaffolding templates.
153155

154-
### Translate Documentation \{#translate}
156+
### Translating Documentation \{#translate}
155157

156158
```bash
157159
doom translate -h
@@ -172,43 +174,43 @@ Options:
172174
-h, --help display help for command
173175
```
174176

175-
- The `-g, --glob` parameter is required and can specify the directory or path of files to be translated, supporting `glob` syntax. Note that the parameter value must be quoted; otherwise, command line parsing may cause unexpected behavior. Examples:
176-
177-
1. `yarn translate -g abc xyz` will translate all documents in the `<root>/<source>/abc` and `<root>/<source>/xyz` directories to `<root>/<target>/abc` and `<root>/<target>/xyz`.
178-
2. `yarn translate -g '*'` will translate all document files under `<root>/<source>`.
179-
180-
- The `-C, --copy` parameter is optional, determining whether to copy local resource files to the target directory when a target file does not exist. The default is `false`, which means changing the reference path of the resource file to the source path. Examples:
177+
- The `-g, --glob` parameter is required. You can specify the directories or paths of files to translate, supporting `glob` syntax. Note that the parameter value must be quoted to avoid unexpected behavior from command line parsing. Examples:
178+
1. `yarn translate -g abc xyz` will translate all documents under `<root>/<source>/abc` and `<root>/<source>/xyz` to `<root>/<target>/abc` and `<root>/<target>/xyz` respectively.
179+
2. `yarn translate -g '*'` will translate all documents under `<root>/<source>`.
180+
- The `-C, --copy` parameter is optional. It controls whether to copy local asset files to the target directory when the target file does not exist. The default is `false`, which means changing the asset reference path to the source path. Examples:
181181
- When this parameter is enabled:
182-
1. Translating `/<source>/abc.jpg` will copy `<root>/public/<source>/abc.jpg` to `<root>/public/<target>/abc.jpg` and change the document's reference path to `/<target>/abc.jpg`.
183-
2. In `<root>/<source>/abc.mdx`, when translating the reference `./assets/xyz.jpg`, it will copy `<root>/<source>/assets/xyz.jpg` to `<root>/<target>/assets/xyz.jpg`, keeping the image reference path unchanged.
184-
3. In `<root>/<source>/abc.mdx`, when translating the reference `./assets/<source>/xyz.jpg`, it will copy `<root>/<source>/assets/<source>/xyz.jpg` to `<root>/<target>/assets/<target>/xyz.jpg` and change the document's reference path to `./assets/<target>/xyz.jpg`.
185-
- If this parameter is not enabled:
186-
1. Translating `/<source>/abc.jpg`, if `<root>/public/<target>/abc.jpg` already exists, will change the document's reference path to `/<target>/abc.jpg`; otherwise, it will keep the image reference path unchanged.
187-
2. In `<root>/<source>/abc.mdx`, when translating the reference `./assets/<source>/xyz.jpg`, if `<root>/<target>/assets/<target>/xyz.jpg` already exists, it will change the document's reference path to `./assets/<target>/xyz.jpg`; otherwise, it will change to `../<source>/assets/<target>/xyz.jpg`.
182+
1. When translating `/<source>/abc.jpg`, `<root>/public/<source>/abc.jpg` will be copied to `<root>/public/<target>/abc.jpg`, and the reference path in the document will be changed to `/<target>/abc.jpg`.
183+
2. In `<root>/<source>/abc.mdx`, the `./assets/xyz.jpg` reference will copy `<root>/<source>/assets/xyz.jpg` to `<root>/<target>/assets/xyz.jpg`, and the image reference path remains unchanged.
184+
3. In `<root>/<source>/abc.mdx`, the `./assets/<source>/xyz.jpg` reference will copy `<root>/<source>/assets/<source>/xyz.jpg` to `<root>/<target>/assets/<target>/xyz.jpg`, and the reference path in the document will be changed to `./assets/<target>/xyz.jpg`.
185+
- When this parameter is not enabled:
186+
1. When translating `/<source>/abc.jpg`, if `<root>/public/<target>/abc.jpg` exists, the reference path in the document will be changed to `/<target>/abc.jpg`; otherwise, the image reference path remains unchanged.
187+
2. In `<root>/<source>/abc.mdx`, if `<root>/<target>/assets/<target>/xyz.jpg` exists, the reference path `./assets/<source>/xyz.jpg` will be changed to `./assets/<target>/xyz.jpg`; otherwise, it will be changed to `../<source>/assets/<target>/xyz.jpg`.
188188

189189
:::warning
190-
In particular, when using `-g '*'` for full translation, the file lists of the `source` and `target` directories will be compared. Any unmatched `target` files, excluding `internalRoutes`, will be automatically deleted.
190+
Specifically, if you use `-g '*'` for full translation, the file lists of the `source` and `target` directories will be compared, and unmatched `target` files except for `internalRoutes` will be automatically deleted.
191191
:::
192192

193193
:::tip
194-
The translation function requires the local environment variable `AZURE_OPENAI_API_KEY` to be configured. Please contact your team leader for this information.
194+
The translation feature requires the local environment variable `AZURE_OPENAI_API_KEY` to be configured. Please contact your team leader to obtain it.
195195
:::
196196

197-
Metadata can be used in the document to control translation behavior:
197+
You can control translation behavior in the document metadata:
198198

199199
```yaml
200200
i18n:
201201
title:
202202
en: DevOps Connectors
203-
additionalPrompts: 'In this text, Connectors is a proper noun, do not translate it.'
203+
additionalPrompts: 'The Connectors in this document are proper nouns and should not be translated'
204204
disableAutoTranslation: false
205-
title: DevOps 连接器
205+
title: DevOps Connectors
206206
```
207207
208-
### Export PDF \{#export}
208+
For more configuration, please refer to [Translation Configuration](./usage/configuration#translate)
209+
210+
### Exporting PDF \{#export}
209211
210212
:::warning
211-
Please run the `yarn build` operation before executing the export operation.
213+
Please run the `yarn build` command before exporting.
212214
:::
213215

214216
```sh
@@ -228,10 +230,29 @@ Options:
228230
-h, --help display help for command
229231
```
230232

231-
Run `yarn export` to export the documentation as a PDF file. Note that if you used `-b`, `-p` options to build, the same options are also required during export.
233+
Run `yarn export` to export the documentation as PDF files. Note that if you used `-b` or `-p` parameters during build, you need to use the same `-b` and `-p` parameters during export.
232234

233-
The export functionality relies on [`playwright`](https://playwright.dev). In the pipeline, please use `build-harbor.alauda.cn/frontend/playwright-runner:doom` as the base image for dependency installation and documentation building. You can set the following environment variable locally to speed up downloads:
235+
The export feature depends on [`playwright`](https://playwright.dev). For CI pipelines, please use `build-harbor.alauda.cn/frontend/playwright-runner:doom` as the base image for dependency installation and documentation building. Locally, you can set the following environment variable to speed up downloads:
234236

235237
```dotenv title=".env.yarn"
236238
PLAYWRIGHT_DOWNLOAD_HOST="https://cdn.npmmirror.com/binaries/playwright"
237239
```
240+
241+
### Documentation Linting \{#lint}
242+
243+
```sh
244+
doom lint -h
245+
246+
# output
247+
Usage: doom lint [options] [root]
248+
249+
Lint the documentation
250+
251+
Arguments:
252+
root Root directory of the documentation
253+
254+
Options:
255+
-h, --help display help for command
256+
```
257+
258+
For more configuration, please refer to [Lint Configuration](./usage/configuration#lint)

0 commit comments

Comments
 (0)