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
-d, --download [boolean] Display download pdf link on nav bar (default: false)
98
-
-e, --export [boolean] Run or build in exporting PDF mode, `apis/**` and `*/apis/**` routes will be ignored automatically (default: false)
99
-
-I, --include <language...> Include **only** the specific language(s), `en ru` for example
100
-
-E, --exclude <language...> Include all languages except the specific language(s), `ru` for example
101
-
-o, --out-dir <path> Override the `outDir` defined in the config file or the default `dist/{base}/{version}`, the resulting path will be `dist/{outDir}/{version}`
102
-
-r, --redirect <enum> Whether to redirect to the locale closest to `navigator.language` when the user visits the site, could be `auto`, `never` or `only-default-lang` (default: "only-default-lang")
103
-
-R, --edit-repo [boolean|url] Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted (default: false)
104
-
-a, --algolia [boolean|alauda] Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
105
-
-S, --site-url Whether to enable the siteUrl for sitemap generation (default: false)
106
-
-n, --no-open Do not open the browser after starting the server
107
-
-h, --help display help for command
88
+
-V, --version output the version number
89
+
-c, --config <config> Specify the path to the config file
90
+
-v <version> Specify the version of the documentation, can also be `unversioned` or `unversioned-x.y`
91
+
-b, --base <base> Override the base of the documentation
92
+
-p, --prefix <prefix> Specify the prefix of the documentation base
93
+
-f, --force [boolean] Force to
94
+
1. fetch latest reference remotes or scaffolding templates, otherwise use local cache
95
+
2. translate ignore hash equality check and original text (default: false)
-d, --download [boolean] Display download pdf link on nav bar (default: false)
98
+
-e, --export [boolean] Run or build in exporting PDF mode, `apis/**` and `*/apis/**` routes will be ignored automatically (default: false)
99
+
-I, --include <language...> Include **only** the specific language(s), `en ru` for example
100
+
-E, --exclude <language...> Include all languages except the specific language(s), `ru` for example
101
+
-o, --out-dir <path> Override the `outDir` defined in the config file or the default `dist/{base}/{version}`, the resulting path will be `dist/{outDir}/{version}`
102
+
-r, --redirect <enum> Whether to redirect to the locale closest to `navigator.language` when the user visits the site, could be `auto`, `never` or `only-default-lang` (default: "only-default-lang")
103
+
-R, --edit-repo [boolean|url|lang] Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted; if a language code is provided, all other languages will use the same repo but with the language code as sub-path (default: false)
104
+
-a, --algolia [boolean|alauda] Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
105
+
-S, --site-url Whether to enable the siteUrl for sitemap generation (default: false)
106
+
-n, --no-open Do not open the browser after starting the server
107
+
-h, --help display help for command
108
108
109
109
Commands:
110
-
dev [options] [root] Start the development server
111
-
build [root] Build the documentation
112
-
preview|serve [options] [root] Preview the built documentation
113
-
new [template] Generate scaffolding from templates
114
-
translate [options] [root] Translate the documentation
115
-
export [options] [root] Export the documentation as PDF, `apis/**` and `*/apis/**` routes will be ignored automatically
116
-
lint [root] Lint the documentation
117
-
help [command] display help for command
110
+
dev [options] [root] Start the development server
111
+
build [root] Build the documentation
112
+
preview|serve [options] [root] Preview the built documentation
113
+
new [template] Generate scaffolding from templates
114
+
translate [options] [root] Translate the documentation
115
+
export [options] [root] Export the documentation as PDF, `apis/**` and `*/apis/**` routes will be ignored automatically
116
+
lint [options] [root] Lint the documentation
117
+
help [command] display help for command
118
118
```
119
119
120
120
For more configuration, please refer to [Configuration](./usage/configuration)
@@ -152,7 +152,7 @@ Run `yarn serve` to preview the built static files. Note that if you used `-b` o
152
152
153
153
### Using Scaffolding Templates \{#new}
154
154
155
-
Run `yarn new` to generate projects, modules, or documentation from scaffolding templates.
155
+
Run `yarn new` to generate projects, modules, or documentation using scaffolding templates.
156
156
157
157
### Translating Documentation \{#translate}
158
158
@@ -175,24 +175,24 @@ Options:
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. You 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
-
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 path to the source path. Examples:
182
-
- When this parameter is enabled:
180
+
2.`yarn translate -g '*'` will translate all documents under `<root>/<source>`.
181
+
- The `-C, --copy` parameter is optional. It controls whether to copy local resource files to the target directory when the target file does not exist. The default is `false`, which means changing the resource file reference path to the source path. Examples:
182
+
- When enabled:
183
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.For`<root>/<source>/abc.mdx` documents, references like`./assets/xyz.jpg` will copy `<root>/<source>/assets/xyz.jpg` to `<root>/<target>/assets/xyz.jpg`, and the image reference path remains unchanged.
185
-
3.For`<root>/<source>/abc.mdx` documents, references like`./assets/<source>/xyz.jpg` 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:
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 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.For`<root>/<source>/abc.mdx` documents, references like`./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.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
-
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
+
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.
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 configuring the `AZURE_OPENAI_API_KEY`environment variable locally. 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 the `yarn build` command before performing the export operation.
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 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.
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
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 build. Locally, you can set the following environment variable to speed up downloads:
Besides exporting a full-site unified PDF document, `doom` also supports exporting a single PDF file by specifying an entry point. For more configuration, please refer to [Document Export Configuration](./usage/configuration#export)
242
+
Besides exporting a complete PDF 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)
243
243
244
244
### Documentation Linting \{#lint}
245
245
@@ -260,7 +260,7 @@ Options:
260
260
-h, --help display helpforcommand
261
261
```
262
262
263
-
`doom lint` is based on [`ESLint`](https://eslint.org/) and [`cspell`](https://cspell.org/). For a better experience in editors, 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:
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:
264
264
265
265
-`eslint.config.mjs`:
266
266
@@ -276,7 +276,7 @@ Options:
276
276
export { default } from'@alauda/doom/cspell'
277
277
```
278
278
279
-
We also agree that the `.cspell` folder in the current working directory (`CWD`) is used 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`:
-d, --download [boolean] Display download pdf link on nav bar (default: false)
94
-
-e, --export [boolean] Run or build in exporting PDF mode, `apis/**` and `*/apis/**` routes will be ignored automatically (default: false)
95
-
-I, --include <language...> Include **only** the specific language(s), `en ru` for example
96
-
-E, --exclude <language...> Include all languages except the specific language(s), `ru` for example
97
-
-o, --out-dir <path> Override the `outDir` defined in the config file or the default `dist/{base}/{version}`, the resulting path will be `dist/{outDir}/{version}`
98
-
-r, --redirect <enum> Whether to redirect to the locale closest to `navigator.language` when the user visits the site, could be `auto`, `never` or `only-default-lang` (default: "only-default-lang")
99
-
-R, --edit-repo [boolean|url] Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted (default: false)
100
-
-a, --algolia [boolean|alauda] Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
101
-
-S, --site-url Whether to enable the siteUrl for sitemap generation (default: false)
102
-
-n, --no-open Do not open the browser after starting the server
103
-
-h, --help display help for command
84
+
-V, --version output the version number
85
+
-c, --config <config> Specify the path to the config file
86
+
-v <version> Specify the version of the documentation, can also be `unversioned` or `unversioned-x.y`
87
+
-b, --base <base> Override the base of the documentation
88
+
-p, --prefix <prefix> Specify the prefix of the documentation base
89
+
-f, --force [boolean] Force to
90
+
1. fetch latest reference remotes or scaffolding templates, otherwise use local cache
91
+
2. translate ignore hash equality check and original text (default: false)
-d, --download [boolean] Display download pdf link on nav bar (default: false)
94
+
-e, --export [boolean] Run or build in exporting PDF mode, `apis/**` and `*/apis/**` routes will be ignored automatically (default: false)
95
+
-I, --include <language...> Include **only** the specific language(s), `en ru` for example
96
+
-E, --exclude <language...> Include all languages except the specific language(s), `ru` for example
97
+
-o, --out-dir <path> Override the `outDir` defined in the config file or the default `dist/{base}/{version}`, the resulting path will be `dist/{outDir}/{version}`
98
+
-r, --redirect <enum> Whether to redirect to the locale closest to `navigator.language` when the user visits the site, could be `auto`, `never` or `only-default-lang` (default: "only-default-lang")
99
+
-R, --edit-repo [boolean|url|lang] Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted; if a language code is provided, all other languages will use the same repo but with the language code as sub-path (default: false)
100
+
-a, --algolia [boolean|alauda] Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
101
+
-S, --site-url Whether to enable the siteUrl for sitemap generation (default: false)
102
+
-n, --no-open Do not open the browser after starting the server
103
+
-h, --help display help for command
104
104
105
105
Commands:
106
-
dev [options] [root] Start the development server
107
-
build [root] Build the documentation
108
-
preview|serve [options] [root] Preview the built documentation
109
-
new [template] Generate scaffolding from templates
110
-
translate [options] [root] Translate the documentation
111
-
export [options] [root] Export the documentation as PDF, `apis/**` and `*/apis/**` routes will be ignored automatically
112
-
lint [root] Lint the documentation
113
-
help [command] display help for command
106
+
dev [options] [root] Start the development server
107
+
build [root] Build the documentation
108
+
preview|serve [options] [root] Preview the built documentation
109
+
new [template] Generate scaffolding from templates
110
+
translate [options] [root] Translate the documentation
111
+
export [options] [root] Export the documentation as PDF, `apis/**` and `*/apis/**` routes will be ignored automatically
0 commit comments