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
-g, --glob <path...> Glob patterns ofsource dirs/files to translate
174
174
-C, --copy [boolean] Whether to copy relative assets to the target directory instead of following links (default: false)
175
175
-h, --help display helpforcommand
176
176
```
177
177
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:
178
+
- The `-g, --glob` parameter is required and can specify the directories or files to translate, supporting `glob` syntax. Note that the parameter value must be quoted to avoid unexpected behavior caused by command line parsing. 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
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:
181
+
- The `-C, --copy` parameter is optional and 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:
182
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`.
183
+
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`.
184
+
2.For `./assets/xyz.jpg` in `<root>/<source>/abc.mdx`, the file `<root>/<source>/assets/xyz.jpg` will be copied to `<root>/<target>/assets/xyz.jpg`, and the image reference path remains unchanged.
185
+
3.For `./assets/<source>/xyz.jpg` in `<root>/<source>/abc.mdx`, the file `<root>/<source>/assets/<source>/xyz.jpg`will be copied to `<root>/<target>/assets/<target>/xyz.jpg`, and the reference path in the document will be changed to `./assets/<target>/xyz.jpg`.
186
186
- When this parameter is not enabled:
187
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`.
188
+
2.For `./assets/<source>/xyz.jpg` in `<root>/<source>/abc.mdx`, if `<root>/<target>/assets/<target>/xyz.jpg` exists, the reference path in the document 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
-
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.
191
+
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.
192
192
:::
193
193
194
194
:::tip
195
-
The translation feature requires the local environment variable `AZURE_OPENAI_API_KEY` to be configured. Please contact your team Leader to obtain it.
195
+
The translation feature requires the local environment variable `AZURE_OPENAI_API_KEY` to be configured. Please contact your team leader to obtain it.
196
196
:::
197
197
198
198
You can control translation behavior in the document metadata:
@@ -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` to build the project before exporting.
214
+
Please run the `yarn build` command before exporting.
215
215
:::
216
216
217
217
```sh
@@ -231,15 +231,15 @@ Options:
231
231
-h, --help display help for command
232
232
```
233
233
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.
234
+
Run `yarn export` to export the documentation as a PDF file. 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
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:
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)
242
+
In addition to exporting a complete PDF document for the entire site, `doom` also supports exporting a single PDF file for a specified entry. For more configuration, please refer to [Documentation Export Configuration](./usage/configuration#export)
-g, --glob <path...> Glob patterns of source dirs/files to lint (default: "**/*.{js,jsx,ts,tsx,md,mdx}")
259
+
--no-cspell Disable cspell linting
260
+
-h, --help display helpforcommand
259
261
```
260
262
261
263
`doom lint` is based on [`ESLint`](https://eslint.org/) and [`cspell`](https://cspell.org/). For a better experience in your editor, you can install the corresponding plugins [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) / [CSpell](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker), then create the corresponding configuration files:
@@ -274,11 +276,11 @@ Options:
274
276
export { default } from'@alauda/doom/cspell'
275
277
```
276
278
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`:
279
+
We also agree that the `.cspell` folder under the current working directory (`CWD`) is used to store CSpell dictionary files. For example, you can create `.cspell/k8s.txt`:
278
280
279
281
```txt
280
282
k8s
281
283
kubernetes
282
284
```
283
285
284
-
For more configuration, please refer to [Documentation Linting Configuration](./usage/configuration#lint)
286
+
For more configuration, please refer to [Lint Configuration](./usage/configuration#lint)
0 commit comments