Skip to content

Commit 11a9ab5

Browse files
committed
fix: known issues
1 parent da7a5d0 commit 11a9ab5

File tree

11 files changed

+75
-15
lines changed

11 files changed

+75
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ jobs:
3939
run: yarn run-p build docs lint typecov
4040
env:
4141
PARSER_NO_WATCH: true
42+
RAW_TERMS_URL: ${{ secrets.RAW_TERMS_URL }}

docs/en/start.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sourceSHA: b375fe90bc3c10daf2cf1af94d73c48daa4fd307ee7d1aad87947d4fe7b6eb1f
2+
sourceSHA: abdacac359849f6bc46d4b115a537545544edd8d5bee65fe8732cd3cea8ec8e9
33
---
44

55
# Start \{#start}
@@ -116,7 +116,7 @@ Commands:
116116
117117
### Start Development Service \{#dev}
118118
119-
Run `yarn dev` to start the development service, and the browser will open the documentation homepage automatically.
119+
Run `yarn dev` to start the development service, and the browser will automatically open the documentation homepage.
120120

121121
```sh
122122
doom dev -h
@@ -188,7 +188,7 @@ In particular, when using `-g '*'` for full translation, the file lists of the `
188188
:::
189189

190190
:::tip
191-
The translation function must have the local environment variable `AZURE_OPENAI_API_KEY` configured. Please contact your team leader for this information.
191+
The translation function requires the local environment variable `AZURE_OPENAI_API_KEY` to be configured. Please contact your team leader for this information.
192192
:::
193193

194194
Metadata can be used in the document to control translation behavior:

docs/en/usage/configuration.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Configure `doom` documentation tool
33
weight: 1
4-
sourceSHA: 8c04921d3d667333d5dd810c99aa189cd38774116eb48bf9425944810e400344
4+
sourceSHA: e06d0647311a571bc2a3584ed125b83d6f6ab016738b27879f59aa32984fdd92
55
---
66

77
# Configuration {#configuration}
@@ -209,3 +209,10 @@ The final output should only include the results from the last step, and previou
209209
```yaml
210210
editRepoBaseUrl: alauda/doom/tree/main/docs # The prefix https://github.com/ can be omitted; it only takes effect when the `-R, --edit-repo` command line flag is enabled.
211211
```
212+
213+
## Document Linting Configuration {#lint}
214+
215+
```yaml
216+
lint:
217+
cspellOptions: # optional, cspell configuration options, refer to https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin#options
218+
```

docs/en/usage/deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: >-
33
After completing the project development, we can deploy the project to the ACP
44
platform.
55
weight: 8
6-
sourceSHA: b8be77fb7d7f9a2fb5fc34de8b0423df711c0220a02acad1c602f6cb2d3ab36a
6+
sourceSHA: 3bb40af83c43ea6f891a330af703b5cb17133d17970dea35cde1a796e5b7b246
77
---
88

99
# Deployment

docs/en/usage/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
weight: 7
3-
sourceSHA: 55d1c3e5a0991772e572dba8f769e80a1b6e32e84abcd3514caaf0028872f785
3+
sourceSHA: ebb89470ba5bca9d172ff55b57b112b9a0376eec28cc74cdd7c8248f3772de44
44
---
55

66
# Referencing Documents

docs/zh/start.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ Commands:
110110
help [command] display help for command
111111
```
112112
113+
更多配置请参考[配置](./usage/configuration)
114+
113115
### 启动开发服务 \{#dev}
114116
115117
执行 `yarn dev` 启动开发服务,浏览器会自动打开文档首页
@@ -197,6 +199,8 @@ i18n:
197199
title: DevOps 连接器
198200
```
199201
202+
更多配置请参考[翻译配置](./usage/configuration#translate)
203+
200204
### 导出 PDF \{#export}
201205
202206
:::warning
@@ -228,3 +232,22 @@ Options:
228232
```dotenv title=".env.yarn"
229233
PLAYWRIGHT_DOWNLOAD_HOST="https://cdn.npmmirror.com/binaries/playwright"
230234
```
235+
236+
### 文档检查 \{#lint}
237+
238+
```sh
239+
doom lint -h
240+
241+
# output
242+
Usage: doom lint [options] [root]
243+
244+
Lint the documentation
245+
246+
Arguments:
247+
root Root directory of the documentation
248+
249+
Options:
250+
-h, --help display help for command
251+
```
252+
253+
更多配置请参考[文档检查配置](./usage/configuration#lint)

docs/zh/usage/configuration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,10 @@ translate:
208208
```yaml
209209
editRepoBaseUrl: alauda/doom/tree/main/docs # https://github.com/ 前缀可以省略,仅当启用 `-R, --edit-repo` 命令行标志符时生效
210210
```
211+
212+
## 文档检查配置 \{#lint}
213+
214+
```yaml
215+
lint:
216+
cspellOptions: # 可选,cspell 配置项,参考 https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin#options
217+
```

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"eslint-plugin-mdx": "^3.4.2",
7676
"html-tag-names": "^2.1.0",
7777
"mdast-util-mdx": "^2.0.1",
78+
"mdast-util-mdx-jsx": "^2.1.4",
7879
"mermaid": "^11.6.0",
7980
"openai": "^5.0.0-beta.0",
8081
"openapi-types": "^12.1.3",
@@ -88,6 +89,7 @@
8889
"remark-directive": "^2.0.1",
8990
"remark-frontmatter": "^4.0.1",
9091
"remark-gfm": "^3.0.1",
92+
"remark-mdx": "^2.3.0",
9193
"remark-stringify": "^10.0.3",
9294
"shiki": "^3.4.2",
9395
"simple-git": "^3.27.0",

src/cli/helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export const defaultGitHubUrl = (url: string) =>
5454

5555
const parseTerms_ = async () => {
5656
const terms = await xfetch(
57-
'https://gitlab-ce.alauda.cn/alauda-public/product-doc-guide/-/raw/main/terms.yaml',
57+
process.env.RAW_TERMS_URL ||
58+
'https://gitlab-ce.alauda.cn/alauda-public/product-doc-guide/-/raw/main/terms.yaml',
5859
{ type: 'text' },
5960
)
6061
return parse(terms) as NormalizedTermItem[]

src/cli/lint.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Options } from '@cspell/eslint-plugin'
22
import cspellRecommended from '@cspell/eslint-plugin/recommended'
33
import js from '@eslint/js'
44
import react from '@eslint-react/eslint-plugin'
5+
import { logger } from '@rspress/shared/logger'
56
import { Command } from 'commander'
67
import { merge } from 'es-toolkit/compat'
78
import { ESLint } from 'eslint'
@@ -37,7 +38,7 @@ export const lintCommand = new Command('lint')
3738
],
3839
},
3940
{
40-
files: ['**/docs/en/**/*.{js,jsx,md,mdx,ts,tsx}'],
41+
files: ['**/en/**/*.{js,jsx,md,mdx,ts,tsx}'],
4142
extends: [cspellRecommended],
4243
rules: {
4344
'@cspell/spellchecker': [
@@ -83,15 +84,31 @@ export const lintCommand = new Command('lint')
8384
]),
8485
})
8586

87+
logger.start('Linting...')
88+
8689
const results = await eslint.lintFiles('**/*.{js,jsx,ts,tsx,md,mdx}')
8790

88-
if (!results.length) {
89-
return
90-
}
91+
const { error, warning } = results.reduce(
92+
(count, result) => ({
93+
error: count.error + result.errorCount,
94+
warning: count.warning + result.warningCount,
95+
}),
96+
{ error: 0, warning: 0 },
97+
)
9198

92-
process.exitCode = 1
99+
logger.info(
100+
`Linting completed with ${error} errors and ${warning} warnings`,
101+
)
93102

94103
const formatter = await eslint.loadFormatter('stylish')
95104

96-
process.stderr.write(await formatter.format(results))
105+
const formatted = await formatter.format(results)
106+
107+
if (formatted) {
108+
console.log(formatted)
109+
}
110+
111+
if (error) {
112+
process.exitCode = 1
113+
}
97114
})

0 commit comments

Comments
 (0)