You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,7 +45,7 @@ Then initialize a configuration file `doom.config.yml`:
45
45
title: My Docs
46
46
```
47
47
48
-
Also create a `tsconfig.json` file with the following content:
48
+
Also create `tsconfig.json` with the following content:
49
49
50
50
```jsonc
51
51
{
@@ -121,7 +121,7 @@ For more configuration, please refer to [Configuration](./usage/configuration)
121
121
122
122
### Starting the Development Server \{#dev}
123
123
124
-
Run `yarn dev` to start the development server, the browser will automatically open the documentation homepage.
124
+
Run `yarn dev` to start the development server; the browser will automatically open the documentation homepage.
125
125
126
126
```sh
127
127
doom dev -h
@@ -148,7 +148,7 @@ Run `yarn build` to build the production code. After building, static files will
148
148
149
149
### Local Preview \{#serve}
150
150
151
-
Run `yarn serve` to preview the built static files. Note that if you used `-b`, `-p` parameters during build, you also need to use `-b`,`-p` parameters during preview.
151
+
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.
152
152
153
153
### Using Scaffolding Templates \{#new}
154
154
@@ -175,20 +175,20 @@ Options:
175
175
-h, --help display helpforcommand
176
176
```
177
177
178
-
- The `-g, --glob` parameter is required and can specify the directories or paths of files to translate, supporting `glob` syntax. Note that the parameter value must be quoted, otherwise it may be parsed unexpectedly by the command line. Examples:
178
+
- 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 the command line parser. Examples:
179
179
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.
180
-
2.`yarn translate -g '*'` will translate all documents under `<root>/<source>`.
181
-
- The `-C, --copy` parameter is optional. It determines 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 file reference path to the source path. Examples:
182
-
- When enabled:
183
-
1. When translating `/<source>/abc.jpg`, it will copy `<root>/public/<source>/abc.jpg` to `<root>/public/<target>/abc.jpg` and update the document reference path to `/<target>/abc.jpg`.
184
-
2. In `<root>/<source>/abc.mdx`, if the document references`./assets/xyz.jpg`, it will copy `<root>/<source>/assets/xyz.jpg` to `<root>/<target>/assets/xyz.jpg`, and the image reference path remains unchanged.
185
-
3. In `<root>/<source>/abc.mdx`, if the document references `./assets/<source>/xyz.jpg`, it will copy `<root>/<source>/assets/<source>/xyz.jpg` to `<root>/<target>/assets/<target>/xyz.jpg` and update the document reference path to `./assets/<target>/xyz.jpg`.
186
-
- When not enabled:
187
-
1. When translating `/<source>/abc.jpg`, if `<root>/public/<target>/abc.jpg` exists, the document reference path will be updated to `/<target>/abc.jpg`; otherwise, the image reference path remains unchanged.
188
-
2. In `<root>/<source>/abc.mdx`, if the document references `./assets/<source>/xyz.jpg`, and`<root>/<target>/assets/<target>/xyz.jpg` exists, the reference path will be updated to `./assets/<target>/xyz.jpg`; otherwise, it will be changed to `../<source>/assets/<target>/xyz.jpg`.
180
+
2.`yarn translate -g '*'` will translate all document files under `<root>/<source>`.
181
+
- 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 paths to the source paths. Examples:
182
+
- When this parameter is enabled:
183
+
1. When translating `/<source>/abc.jpg`, it will copy `<root>/public/<source>/abc.jpg` to `<root>/public/<target>/abc.jpg` and modify the reference path in the document to `/<target>/abc.jpg`.
184
+
2. In `<root>/<source>/abc.mdx`, when translating`./assets/xyz.jpg`, it will copy `<root>/<source>/assets/xyz.jpg` to `<root>/<target>/assets/xyz.jpg`, and the image reference path remains unchanged.
185
+
3. In `<root>/<source>/abc.mdx`, when translating `./assets/<source>/xyz.jpg`, it will copy `<root>/<source>/assets/<source>/xyz.jpg` to `<root>/<target>/assets/<target>/xyz.jpg` and modify the reference path in the document to `./assets/<target>/xyz.jpg`.
186
+
- When this parameter is not enabled:
187
+
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.
188
+
2. In `<root>/<source>/abc.mdx`, when translating `./assets/<source>/xyz.jpg`, if`<root>/<target>/assets/<target>/xyz.jpg` exists, the reference path will be changed to `./assets/<target>/xyz.jpg`; otherwise, it will be changed to `../<source>/assets/<target>/xyz.jpg`.
189
189
190
190
:::warning
191
-
Specially, if you use `-g '*'` for full translation, the file lists of `source` and `target` directories will be compared, and unmatched `target` files except for `internalRoutes` will be automatically deleted.
191
+
Specifically, if you use `-g '*'` for full translation, the file lists of `source` and `target` directories will be compared, and unmatched `target` files except for `internalRoutes` will be automatically deleted.
192
192
:::
193
193
194
194
:::tip
@@ -211,7 +211,7 @@ For more configuration, please refer to [Translation Configuration](./usage/conf
211
211
### Exporting PDF \{#export}
212
212
213
213
:::warning
214
-
Please run `yarn build` before performing the export operation.
214
+
Please run `yarn build` to build the project before exporting.
215
215
:::
216
216
217
217
```sh
@@ -231,17 +231,15 @@ Options:
231
231
-h, --help display help for command
232
232
```
233
233
234
-
Run `yarn export` to export the documentation as a PDF file. Note that if you used `-b`, `-p` parameters during build, you also need to use `-b`,`-p` parameters during export.
234
+
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.
235
235
236
-
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.
237
-
238
-
Locally, you can set the following environment variable to speed up downloads:
236
+
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:
For more configuration, please refer to [Documentation Export Configuration](./usage/configuration#export)
242
+
Besides exporting a unified full-site PDF, `doom` also supports exporting a single PDF file for a specified entry. For more configuration, please refer to [Documentation Export Configuration](./usage/configuration#export)
245
243
246
244
### Documentation Linting \{#lint}
247
245
@@ -276,7 +274,7 @@ Options:
276
274
export { default } from'@alauda/doom/cspell'
277
275
```
278
276
279
-
We also conventionally use the `.cspell` folder in the current working directory (`CWD`) to store CSpell dictionary files. For example, you can create `.cspell/k8s.txt`:
277
+
We also conventionally use the `.cspell` folder under the current working directory (`CWD`) to store CSpell dictionary files. For example, you can create `.cspell/k8s.txt`:
0 commit comments