@aigne/doc-smith 0.8.11-beta.4 → 0.8.11-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aigne/doc-smith/config.yaml +2 -4
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +17 -2
- package/README.md +1 -1
- package/agents/clear/choose-contents.mjs +2 -2
- package/agents/clear/clear-document-structure.mjs +8 -8
- package/agents/clear/index.yaml +1 -1
- package/agents/evaluate/document-structure.yaml +1 -1
- package/agents/generate/check-d2-diagram-valid.mjs +26 -0
- package/agents/generate/check-document-structure.yaml +3 -3
- package/agents/generate/check-need-generate-structure.mjs +8 -8
- package/agents/generate/document-structure-tools/add-document.mjs +3 -3
- package/agents/generate/document-structure-tools/delete-document.mjs +2 -2
- package/agents/generate/document-structure-tools/move-document.mjs +3 -2
- package/agents/generate/document-structure-tools/update-document.mjs +2 -2
- package/agents/generate/generate-d2-diagram.yaml +23 -0
- package/agents/generate/generate-structure.yaml +1 -1
- package/agents/generate/merge-d2-diagram.yaml +39 -0
- package/agents/generate/update-document-structure.yaml +3 -3
- package/agents/generate/user-review-document-structure.mjs +10 -10
- package/agents/init/index.mjs +18 -10
- package/agents/publish/publish-docs.mjs +17 -20
- package/agents/update/batch-generate-document.yaml +1 -1
- package/agents/update/check-document.mjs +2 -2
- package/agents/update/generate-document.yaml +25 -0
- package/agents/utils/check-feedback-refiner.mjs +1 -1
- package/agents/utils/choose-docs.mjs +1 -1
- package/agents/utils/load-document-all-content.mjs +3 -3
- package/agents/utils/load-sources.mjs +1 -1
- package/agents/utils/save-docs.mjs +7 -28
- package/aigne.yaml +2 -2
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.md +3 -3
- package/docs/advanced-quality-assurance.md +1 -1
- package/docs/cli-reference.ja.md +151 -80
- package/docs/cli-reference.md +126 -55
- package/docs/cli-reference.zh-TW.md +133 -62
- package/docs/cli-reference.zh.md +143 -72
- package/docs/configuration-interactive-setup.md +1 -1
- package/docs/configuration-language-support.md +1 -1
- package/docs/configuration-preferences.md +1 -1
- package/docs/configuration.ja.md +104 -48
- package/docs/configuration.md +58 -2
- package/docs/configuration.zh-TW.md +99 -42
- package/docs/configuration.zh.md +78 -21
- package/docs/features-generate-documentation.ja.md +63 -44
- package/docs/features-generate-documentation.md +54 -35
- package/docs/features-generate-documentation.zh-TW.md +67 -48
- package/docs/features-generate-documentation.zh.md +61 -41
- package/docs/features-publish-your-docs.ja.md +69 -46
- package/docs/features-publish-your-docs.md +65 -42
- package/docs/features-publish-your-docs.zh-TW.md +73 -50
- package/docs/features-publish-your-docs.zh.md +67 -44
- package/docs/features-translate-documentation.ja.md +35 -33
- package/docs/features-translate-documentation.md +24 -22
- package/docs/features-translate-documentation.zh-TW.md +32 -30
- package/docs/features-translate-documentation.zh.md +29 -27
- package/docs/features-update-and-refine.ja.md +120 -66
- package/docs/features-update-and-refine.md +110 -56
- package/docs/features-update-and-refine.zh-TW.md +116 -62
- package/docs/features-update-and-refine.zh.md +118 -64
- package/docs/getting-started.ja.md +22 -22
- package/docs/getting-started.md +1 -1
- package/docs/getting-started.zh-TW.md +16 -16
- package/docs/getting-started.zh.md +28 -28
- package/docs/overview.md +3 -3
- package/docs-mcp/analyze-docs-relevance.yaml +6 -6
- package/docs-mcp/docs-search.yaml +1 -1
- package/package.json +3 -3
- package/prompts/common/document-structure/conflict-resolution-guidance.md +3 -3
- package/prompts/common/document-structure/document-structure-rules.md +2 -2
- package/prompts/detail/{d2-chart/rules.md → d2-diagram/rules-system.md} +41 -5
- package/prompts/detail/d2-diagram/rules-user.md +4 -0
- package/prompts/detail/document-rules.md +3 -4
- package/prompts/detail/generate-document.md +8 -2
- package/prompts/detail/update-document.md +0 -2
- package/prompts/evaluate/document-structure.md +6 -6
- package/prompts/structure/check-document-structure.md +10 -10
- package/prompts/structure/document-rules.md +2 -2
- package/prompts/structure/generate-structure-system.md +3 -3
- package/prompts/structure/structure-example.md +1 -1
- package/prompts/structure/structure-getting-started.md +1 -1
- package/prompts/structure/update-document-structure.md +9 -9
- package/prompts/utils/feedback-refiner.md +1 -1
- package/tests/agents/clear/choose-contents.test.mjs +1 -1
- package/tests/agents/clear/clear-document-structure.test.mjs +36 -30
- package/tests/agents/evaluate/generate-report.test.mjs +1 -1
- package/tests/agents/generate/check-need-generate-structure.test.mjs +1 -1
- package/tests/agents/generate/document-structure-tools/add-document.test.mjs +2 -2
- package/tests/agents/generate/document-structure-tools/delete-document.test.mjs +4 -4
- package/tests/agents/generate/document-structure-tools/move-document.test.mjs +3 -3
- package/tests/agents/generate/document-structure-tools/update-document.test.mjs +3 -3
- package/tests/agents/generate/user-review-document-structure.test.mjs +7 -5
- package/tests/agents/init/init.test.mjs +25 -19
- package/tests/agents/publish/publish-docs.test.mjs +99 -0
- package/tests/agents/update/check-document.test.mjs +1 -1
- package/tests/agents/utils/check-detail-result.test.mjs +2 -15
- package/tests/agents/utils/format-document-structure.test.mjs +5 -5
- package/tests/agents/utils/load-sources.test.mjs +4 -4
- package/tests/agents/utils/save-docs.test.mjs +1 -1
- package/tests/utils/auth-utils.test.mjs +1 -1
- package/tests/utils/conflict-detector.test.mjs +1 -1
- package/tests/utils/d2-utils.test.mjs +4 -4
- package/tests/utils/deploy.test.mjs +3 -10
- package/tests/utils/docs-finder-utils.test.mjs +8 -8
- package/tests/utils/kroki-utils.test.mjs +5 -5
- package/tests/utils/preferences-utils.test.mjs +5 -3
- package/tests/utils/save-value-to-config.test.mjs +3 -1
- package/types/document-structure-schema.mjs +9 -9
- package/utils/auth-utils.mjs +4 -0
- package/utils/conflict-detector.mjs +1 -1
- package/utils/constants/index.mjs +7 -4
- package/utils/d2-utils.mjs +11 -6
- package/utils/deploy.mjs +4 -20
- package/utils/docs-finder-utils.mjs +11 -11
- package/utils/kroki-utils.mjs +5 -4
- package/utils/markdown-checker.mjs +1 -21
- /package/prompts/detail/{d2-chart → d2-diagram}/official-examples.md +0 -0
|
@@ -1,58 +1,81 @@
|
|
|
1
1
|
# Publish Your Docs
|
|
2
2
|
|
|
3
|
-
After generating your documentation, the `aigne doc publish` command uploads your
|
|
3
|
+
After generating your documentation, the `aigne doc publish` command uploads your files and makes them accessible via a shareable link. This guide provides a step-by-step process for publishing your documentation to either the official AIGNE platform or a self-hosted instance.
|
|
4
4
|
|
|
5
5
|
## The Publishing Process
|
|
6
6
|
|
|
7
|
-
The `aigne doc publish` command
|
|
7
|
+
The `aigne doc publish` command starts an interactive workflow. The first time you publish to a destination, the CLI will open a browser to guide you through a one-time authentication process. For subsequent publishes, it will use the saved credentials stored in `~/.aigne/doc-smith-connected.yaml`.
|
|
8
8
|
|
|
9
|
-
```d2 The Publishing
|
|
10
|
-
direction: down
|
|
9
|
+
```d2 The Publishing Workflow icon=lucide:upload-cloud
|
|
11
10
|
shape: sequence_diagram
|
|
12
11
|
|
|
13
|
-
User: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Platform: { label: "Discuss Kit Platform" }
|
|
17
|
-
|
|
18
|
-
User -> CLI: "aigne doc publish"
|
|
19
|
-
|
|
20
|
-
alt: "First-time publish or missing config" {
|
|
21
|
-
CLI -> User: "Select Platform\n(Official / Self-Hosted)"
|
|
22
|
-
User -> CLI: "Provides selection"
|
|
23
|
-
CLI -> Browser: "Opens authentication URL"
|
|
24
|
-
User -> Browser: "Logs in & authorizes"
|
|
25
|
-
Browser -> Platform: "Sends credentials"
|
|
26
|
-
Platform -> CLI: "Returns Access Token"
|
|
27
|
-
CLI -> CLI: "Saves Token for future use"
|
|
12
|
+
User: {
|
|
13
|
+
label: "Developer / CI-CD"
|
|
14
|
+
shape: c4-person
|
|
28
15
|
}
|
|
29
16
|
|
|
30
|
-
CLI
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
CLI: {
|
|
18
|
+
label: "CLI\n(aigne doc publish)"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Local-Config: {
|
|
22
|
+
label: "Local Config\n(~/.aigne/...)"
|
|
23
|
+
shape: cylinder
|
|
24
|
+
}
|
|
33
25
|
|
|
26
|
+
Browser
|
|
27
|
+
|
|
28
|
+
Platform: {
|
|
29
|
+
label: "Platform\n(Official or Self-Hosted)"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
User -> CLI: "Run command"
|
|
33
|
+
|
|
34
|
+
alt "Interactive Mode" {
|
|
35
|
+
CLI -> Local-Config: "Check for credentials"
|
|
36
|
+
opt "Credentials not found (First time)" {
|
|
37
|
+
CLI -> User: "Prompt to choose platform"
|
|
38
|
+
User -> CLI: "Platform selected"
|
|
39
|
+
CLI -> Browser: "Open auth URL"
|
|
40
|
+
User -> Browser: "Login & Authorize"
|
|
41
|
+
Browser -> Platform: "Request token"
|
|
42
|
+
Platform -> Browser: "Return token"
|
|
43
|
+
Browser -> CLI: "Send token to CLI"
|
|
44
|
+
CLI -> Local-Config: "Save credentials"
|
|
45
|
+
}
|
|
46
|
+
CLI -> Platform: "Upload documentation"
|
|
47
|
+
Platform -> CLI: "Confirm success"
|
|
48
|
+
CLI -> User: "Display success message"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
alt "CI/CD Mode" {
|
|
52
|
+
note over CLI: "Reads token from ENV VAR"
|
|
53
|
+
CLI -> Platform: "Upload documentation"
|
|
54
|
+
Platform -> CLI: "Confirm success"
|
|
55
|
+
CLI -> User: "Return success status"
|
|
56
|
+
}
|
|
34
57
|
```
|
|
35
58
|
|
|
36
59
|
## Publishing Options
|
|
37
60
|
|
|
38
|
-
You
|
|
61
|
+
You can choose between two primary destinations for hosting your documentation:
|
|
39
62
|
|
|
40
63
|
<x-cards data-columns="2">
|
|
41
64
|
<x-card data-title="Official Platform" data-icon="lucide:globe">
|
|
42
|
-
Publish to
|
|
65
|
+
Publish to docsmith.aigne.io, a service operated by AIGNE. This is a straightforward option for open-source projects or for quickly sharing your documentation publicly.
|
|
43
66
|
</x-card>
|
|
44
|
-
<x-card data-title="
|
|
45
|
-
Publish to your own Discuss Kit instance for
|
|
67
|
+
<x-card data-title="Self-Hosted Instance" data-icon="lucide:server">
|
|
68
|
+
Publish to your own Discuss Kit instance for complete control over branding, access, and data privacy. This is the recommended option for internal or private documentation. You can run your own Discuss Kit instance by following the instructions available at the official documentation.
|
|
46
69
|
</x-card>
|
|
47
70
|
</x-cards>
|
|
48
71
|
|
|
49
72
|
## Step-by-Step Guide
|
|
50
73
|
|
|
51
|
-
Follow these steps to publish your documentation
|
|
74
|
+
Follow these steps to publish your documentation.
|
|
52
75
|
|
|
53
76
|
### 1. Run the Publish Command
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
Navigate to your project's root directory and execute the following command:
|
|
56
79
|
|
|
57
80
|
```bash Terminal icon=lucide:terminal
|
|
58
81
|
aigne doc publish
|
|
@@ -60,19 +83,19 @@ aigne doc publish
|
|
|
60
83
|
|
|
61
84
|
### 2. Choose Your Platform
|
|
62
85
|
|
|
63
|
-
If this is your first time publishing, you will be prompted to select a destination. Choose the option that fits your
|
|
86
|
+
If this is your first time publishing, you will be prompted to select a destination. Choose the option that fits your requirements.
|
|
64
87
|
|
|
65
|
-

|
|
66
89
|
|
|
67
|
-
If you select
|
|
90
|
+
If you select a self-hosted instance, you will be asked to enter its URL.
|
|
68
91
|
|
|
69
92
|
### 3. Authenticate Your Account
|
|
70
93
|
|
|
71
|
-
For the
|
|
94
|
+
For the initial connection, a browser window will open automatically for you to log in and authorize the CLI. This step is only required once per platform. The access token is saved locally for future use.
|
|
72
95
|
|
|
73
96
|
### 4. Confirmation
|
|
74
97
|
|
|
75
|
-
Once the upload is complete, a success message will appear in your terminal.
|
|
98
|
+
Once the upload is complete, a success message will appear in your terminal, confirming that the documentation is live.
|
|
76
99
|
|
|
77
100
|
```
|
|
78
101
|
✅ Documentation Published Successfully!
|
|
@@ -80,14 +103,14 @@ Once the upload is complete, a success message will appear in your terminal.
|
|
|
80
103
|
|
|
81
104
|
## Publishing in CI/CD Environments
|
|
82
105
|
|
|
83
|
-
|
|
106
|
+
To use the publish command in automated workflows like CI/CD pipelines, you can bypass the interactive prompts by providing the necessary information through arguments and environment variables.
|
|
84
107
|
|
|
85
108
|
| Method | Name | Description |
|
|
86
109
|
|---|---|---|
|
|
87
|
-
| **Argument** | `--appUrl` | Specifies the URL of your Discuss Kit instance
|
|
88
|
-
| **Env Var** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | Provides the access token
|
|
110
|
+
| **Argument** | `--appUrl` | Specifies the URL of your Discuss Kit instance. |
|
|
111
|
+
| **Env Var** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | Provides the access token to skip the interactive login process. |
|
|
89
112
|
|
|
90
|
-
Here is an example of a non-interactive publish command suitable for a CI/CD
|
|
113
|
+
Here is an example of a non-interactive publish command suitable for a CI/CD script:
|
|
91
114
|
|
|
92
115
|
```bash CI/CD Example icon=lucide:workflow
|
|
93
116
|
export DOC_DISCUSS_KIT_ACCESS_TOKEN="your_access_token_here"
|
|
@@ -96,12 +119,12 @@ aigne doc publish --appUrl https://docs.mycompany.com
|
|
|
96
119
|
|
|
97
120
|
## Troubleshooting
|
|
98
121
|
|
|
99
|
-
If you encounter an issue during publishing,
|
|
122
|
+
If you encounter an issue during the publishing process, it may be due to one of the following common problems.
|
|
100
123
|
|
|
101
|
-
- **Connection Error**: The
|
|
124
|
+
- **Connection Error**: The CLI may return an error message like `Unable to connect to: <URL>`. This can be caused by network issues, a server that is temporarily unavailable, or an incorrect URL. Verify that the URL is correct and the server is reachable.
|
|
102
125
|
|
|
103
|
-
- **Invalid Website URL**: The
|
|
126
|
+
- **Invalid Website URL**: The command may fail with the message `The provided URL is not a valid website on ArcBlock platform`. The destination URL must be a website built on the ArcBlock platform. To host your documentation, you can run your own instance of Discuss Kit.
|
|
104
127
|
|
|
105
|
-
- **Missing Required Components**:
|
|
128
|
+
- **Missing Required Components**: An error stating `This website does not have required components for publishing` indicates that the destination website does not have the Discuss Kit component installed. Please refer to the Discuss Kit documentation to add the necessary component to your site.
|
|
106
129
|
|
|
107
|
-
For a complete list of commands and options,
|
|
130
|
+
For a complete list of commands and options, see the [CLI Command Reference](./cli-reference.md).
|
|
@@ -1,58 +1,81 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 發佈您的文件
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
產生您的文件後,`aigne doc publish` 指令會上傳您的檔案,並透過可分享的連結使其可供存取。本指南提供了將您的文件發佈到官方 AIGNE 平台或自行託管實例的逐步流程。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 發佈流程
|
|
6
6
|
|
|
7
|
-
`aigne doc publish`
|
|
7
|
+
`aigne doc publish` 指令會啟動一個互動式工作流程。當您第一次發佈到某個目的地時,CLI 會開啟瀏覽器引導您完成一次性的身份驗證過程。對於後續的發佈,它將使用儲存在 `~/.aigne/doc-smith-connected.yaml` 中的已儲存憑證。
|
|
8
8
|
|
|
9
|
-
```d2
|
|
10
|
-
direction: down
|
|
9
|
+
```d2 The Publishing Workflow icon=lucide:upload-cloud
|
|
11
10
|
shape: sequence_diagram
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
平台: { label: "Discuss Kit 平台" }
|
|
17
|
-
|
|
18
|
-
使用者 -> CLI: "aigne doc publish"
|
|
19
|
-
|
|
20
|
-
alt: "首次發布或缺少設定" {
|
|
21
|
-
CLI -> 使用者: "選擇平台\n(官方 / 自行託管)"
|
|
22
|
-
使用者 -> CLI: "提供選擇"
|
|
23
|
-
CLI -> 瀏覽器: "開啟驗證 URL"
|
|
24
|
-
使用者 -> 瀏覽器: "登入並授權"
|
|
25
|
-
瀏覽器 -> 平台: "傳送憑證"
|
|
26
|
-
平台 -> CLI: "返回存取權杖"
|
|
27
|
-
CLI -> CLI: "儲存權杖以供未來使用"
|
|
12
|
+
User: {
|
|
13
|
+
label: "開發者 / CI-CD"
|
|
14
|
+
shape: c4-person
|
|
28
15
|
}
|
|
29
16
|
|
|
30
|
-
CLI
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
CLI: {
|
|
18
|
+
label: "CLI\n(aigne doc publish)"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Local-Config: {
|
|
22
|
+
label: "本地設定\n(~/.aigne/...)"
|
|
23
|
+
shape: cylinder
|
|
24
|
+
}
|
|
33
25
|
|
|
26
|
+
Browser
|
|
27
|
+
|
|
28
|
+
Platform: {
|
|
29
|
+
label: "平台\n(官方或自行託管)"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
User -> CLI: "執行指令"
|
|
33
|
+
|
|
34
|
+
alt "互動模式" {
|
|
35
|
+
CLI -> Local-Config: "檢查憑證"
|
|
36
|
+
opt "找不到憑證 (首次)" {
|
|
37
|
+
CLI -> User: "提示選擇平台"
|
|
38
|
+
User -> CLI: "已選擇平台"
|
|
39
|
+
CLI -> Browser: "開啟驗證 URL"
|
|
40
|
+
User -> Browser: "登入並授權"
|
|
41
|
+
Browser -> Platform: "請求權杖"
|
|
42
|
+
Platform -> Browser: "返回權杖"
|
|
43
|
+
Browser -> CLI: "傳送權杖至 CLI"
|
|
44
|
+
CLI -> Local-Config: "儲存憑證"
|
|
45
|
+
}
|
|
46
|
+
CLI -> Platform: "上傳文件"
|
|
47
|
+
Platform -> CLI: "確認成功"
|
|
48
|
+
CLI -> User: "顯示成功訊息"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
alt "CI/CD 模式" {
|
|
52
|
+
note over CLI: "從環境變數讀取權杖"
|
|
53
|
+
CLI -> Platform: "上傳文件"
|
|
54
|
+
Platform -> CLI: "確認成功"
|
|
55
|
+
CLI -> User: "返回成功狀態"
|
|
56
|
+
}
|
|
34
57
|
```
|
|
35
58
|
|
|
36
|
-
##
|
|
59
|
+
## 發佈選項
|
|
37
60
|
|
|
38
|
-
|
|
61
|
+
您可以選擇兩個主要的目的地來託管您的文件:
|
|
39
62
|
|
|
40
63
|
<x-cards data-columns="2">
|
|
41
64
|
<x-card data-title="官方平台" data-icon="lucide:globe">
|
|
42
|
-
|
|
65
|
+
發佈到由 AIGNE 營運的服務 docsmith.aigne.io。對於開源專案或希望快速公開分享文件的使用者來說,這是一個直接的選項。
|
|
43
66
|
</x-card>
|
|
44
|
-
<x-card data-title="
|
|
45
|
-
|
|
67
|
+
<x-card data-title="自行託管實例" data-icon="lucide:server">
|
|
68
|
+
發佈到您自己的 Discuss Kit 實例,以完全控制品牌、存取權限和資料隱私。這是內部或私有文件的推薦選項。您可以按照官方文件中的說明來執行您自己的 Discuss Kit 實例。
|
|
46
69
|
</x-card>
|
|
47
70
|
</x-cards>
|
|
48
71
|
|
|
49
|
-
##
|
|
72
|
+
## 逐步指南
|
|
50
73
|
|
|
51
|
-
|
|
74
|
+
請按照以下步驟發佈您的文件。
|
|
52
75
|
|
|
53
|
-
### 1.
|
|
76
|
+
### 1. 執行發佈指令
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
導覽至您專案的根目錄並執行以下指令:
|
|
56
79
|
|
|
57
80
|
```bash Terminal icon=lucide:terminal
|
|
58
81
|
aigne doc publish
|
|
@@ -60,48 +83,48 @@ aigne doc publish
|
|
|
60
83
|
|
|
61
84
|
### 2. 選擇您的平台
|
|
62
85
|
|
|
63
|
-
|
|
86
|
+
如果這是您第一次發佈,系統會提示您選擇一個目的地。請選擇符合您需求的選項。
|
|
64
87
|
|
|
65
|
-

|
|
66
89
|
|
|
67
|
-
|
|
90
|
+
如果您選擇自行託管的實例,系統會要求您輸入其 URL。
|
|
68
91
|
|
|
69
92
|
### 3. 驗證您的帳戶
|
|
70
93
|
|
|
71
|
-
|
|
94
|
+
初次連線時,瀏覽器視窗會自動開啟,讓您登入並授權給 CLI。此步驟每個平台僅需執行一次。存取權杖會儲存在本機以供未來使用。
|
|
72
95
|
|
|
73
96
|
### 4. 確認
|
|
74
97
|
|
|
75
|
-
|
|
98
|
+
上傳完成後,您的終端機中會出現一條成功訊息,確認文件已上線。
|
|
76
99
|
|
|
77
100
|
```
|
|
78
|
-
✅
|
|
101
|
+
✅ Documentation Published Successfully!
|
|
79
102
|
```
|
|
80
103
|
|
|
81
|
-
## 在 CI/CD
|
|
104
|
+
## 在 CI/CD 環境中發佈
|
|
82
105
|
|
|
83
|
-
|
|
106
|
+
若要在 CI/CD 管線等自動化工作流程中使用發佈指令,您可以透過參數和環境變數提供必要的資訊,以繞過互動式提示。
|
|
84
107
|
|
|
85
108
|
| 方法 | 名稱 | 說明 |
|
|
86
109
|
|---|---|---|
|
|
87
|
-
| **參數** | `--appUrl` |
|
|
88
|
-
| **環境變數** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` |
|
|
110
|
+
| **參數** | `--appUrl` | 指定您的 Discuss Kit 實例的 URL。 |
|
|
111
|
+
| **環境變數** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | 提供存取權杖以跳過互動式登入過程。 |
|
|
89
112
|
|
|
90
|
-
|
|
113
|
+
以下是一個適用於 CI/CD 指令碼的非互動式發佈指令範例:
|
|
91
114
|
|
|
92
|
-
```bash CI/CD
|
|
115
|
+
```bash CI/CD Example icon=lucide:workflow
|
|
93
116
|
export DOC_DISCUSS_KIT_ACCESS_TOKEN="your_access_token_here"
|
|
94
117
|
aigne doc publish --appUrl https://docs.mycompany.com
|
|
95
118
|
```
|
|
96
119
|
|
|
97
120
|
## 疑難排解
|
|
98
121
|
|
|
99
|
-
|
|
122
|
+
如果您在發佈過程中遇到問題,可能是由以下常見問題之一所引起。
|
|
100
123
|
|
|
101
|
-
-
|
|
124
|
+
- **連線錯誤**:CLI 可能會返回類似 `Unable to connect to: <URL>` 的錯誤訊息。這可能是由網路問題、伺服器暫時無法使用或 URL 不正確所引起。請確認 URL 是否正確且伺服器是否可連線。
|
|
102
125
|
|
|
103
|
-
- **無效的網站 URL
|
|
126
|
+
- **無效的網站 URL**:指令可能會失敗並顯示訊息 `The provided URL is not a valid website on ArcBlock platform`。目標 URL 必須是建立在 ArcBlock 平台上的網站。若要託管您的文件,您可以執行自己的 Discuss Kit 實例。
|
|
104
127
|
|
|
105
|
-
-
|
|
128
|
+
- **缺少必要元件**:一個錯誤訊息,內容為 `This website does not have required components for publishing` 表示目標網站未安裝 Discuss Kit 元件。請參閱 Discuss Kit 文件,將必要的元件新增到您的網站。
|
|
106
129
|
|
|
107
|
-
|
|
130
|
+
有關指令和選項的完整列表,請參閱 [CLI 指令參考](./cli-reference.md)。
|
|
@@ -1,58 +1,81 @@
|
|
|
1
1
|
# 发布您的文档
|
|
2
2
|
|
|
3
|
-
生成文档后,`aigne doc publish`
|
|
3
|
+
生成文档后,`aigne doc publish` 命令会上传您的文件,并通过一个可共享的链接使其可访问。本指南提供了将文档发布到 AIGNE 官方平台或自托管实例的分步过程。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 发布过程
|
|
6
6
|
|
|
7
|
-
`aigne doc publish`
|
|
7
|
+
`aigne doc publish` 命令会启动一个交互式工作流程。当您首次发布到某个目标时,CLI 将打开一个浏览器来引导您完成一次性身份验证过程。对于后续的发布,它将使用保存在 `~/.aigne/doc-smith-connected.yaml` 中的凭证。
|
|
8
8
|
|
|
9
|
-
```d2
|
|
10
|
-
direction: down
|
|
9
|
+
```d2 The Publishing Workflow icon=lucide:upload-cloud
|
|
11
10
|
shape: sequence_diagram
|
|
12
11
|
|
|
13
|
-
User: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Platform: { label: "Discuss Kit 平台" }
|
|
17
|
-
|
|
18
|
-
User -> CLI: "aigne doc publish"
|
|
19
|
-
|
|
20
|
-
alt: "首次发布或缺少配置" {
|
|
21
|
-
CLI -> User: "选择平台\n(官方 / 自托管)"
|
|
22
|
-
User -> CLI: "提供选择"
|
|
23
|
-
CLI -> Browser: "打开认证 URL"
|
|
24
|
-
User -> Browser: "登录并授权"
|
|
25
|
-
Browser -> Platform: "发送凭据"
|
|
26
|
-
Platform -> CLI: "返回访问令牌"
|
|
27
|
-
CLI -> CLI: "保存令牌以备将来使用"
|
|
12
|
+
User: {
|
|
13
|
+
label: "开发者 / CI-CD"
|
|
14
|
+
shape: c4-person
|
|
28
15
|
}
|
|
29
16
|
|
|
30
|
-
CLI
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
CLI: {
|
|
18
|
+
label: "CLI\n(aigne doc publish)"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Local-Config: {
|
|
22
|
+
label: "本地配置\n(~/.aigne/...)"
|
|
23
|
+
shape: cylinder
|
|
24
|
+
}
|
|
33
25
|
|
|
26
|
+
Browser
|
|
27
|
+
|
|
28
|
+
Platform: {
|
|
29
|
+
label: "平台\n(官方或自托管)"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
User -> CLI: "运行命令"
|
|
33
|
+
|
|
34
|
+
alt "交互模式" {
|
|
35
|
+
CLI -> Local-Config: "检查凭证"
|
|
36
|
+
opt "未找到凭证 (首次)" {
|
|
37
|
+
CLI -> User: "提示选择平台"
|
|
38
|
+
User -> CLI: "平台已选择"
|
|
39
|
+
CLI -> Browser: "打开认证 URL"
|
|
40
|
+
User -> Browser: "登录并授权"
|
|
41
|
+
Browser -> Platform: "请求令牌"
|
|
42
|
+
Platform -> Browser: "返回令牌"
|
|
43
|
+
Browser -> CLI: "发送令牌到 CLI"
|
|
44
|
+
CLI -> Local-Config: "保存凭证"
|
|
45
|
+
}
|
|
46
|
+
CLI -> Platform: "上传文档"
|
|
47
|
+
Platform -> CLI: "确认成功"
|
|
48
|
+
CLI -> User: "显示成功消息"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
alt "CI/CD 模式" {
|
|
52
|
+
note over CLI: "从环境变量读取令牌"
|
|
53
|
+
CLI -> Platform: "上传文档"
|
|
54
|
+
Platform -> CLI: "确认成功"
|
|
55
|
+
CLI -> User: "返回成功状态"
|
|
56
|
+
}
|
|
34
57
|
```
|
|
35
58
|
|
|
36
59
|
## 发布选项
|
|
37
60
|
|
|
38
|
-
|
|
61
|
+
您可以选择两个主要的目标来托管您的文档:
|
|
39
62
|
|
|
40
63
|
<x-cards data-columns="2">
|
|
41
64
|
<x-card data-title="官方平台" data-icon="lucide:globe">
|
|
42
|
-
发布到
|
|
65
|
+
发布到 docsmith.aigne.io,这是由 AIGNE 运营的服务。对于开源项目或希望快速公开分享文档的用户来说,这是一个直接的选择。
|
|
43
66
|
</x-card>
|
|
44
|
-
<x-card data-title="
|
|
45
|
-
发布到您自己的 Discuss Kit
|
|
67
|
+
<x-card data-title="自托管实例" data-icon="lucide:server">
|
|
68
|
+
发布到您自己的 Discuss Kit 实例,以完全控制品牌、访问权限和数据隐私。这是内部或私有文档的推荐选项。您可以按照官方文档中的说明运行自己的 Discuss Kit 实例。
|
|
46
69
|
</x-card>
|
|
47
70
|
</x-cards>
|
|
48
71
|
|
|
49
72
|
## 分步指南
|
|
50
73
|
|
|
51
|
-
|
|
74
|
+
请按照以下步骤发布您的文档。
|
|
52
75
|
|
|
53
76
|
### 1. 运行发布命令
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
导航到您项目的根目录并执行以下命令:
|
|
56
79
|
|
|
57
80
|
```bash Terminal icon=lucide:terminal
|
|
58
81
|
aigne doc publish
|
|
@@ -60,19 +83,19 @@ aigne doc publish
|
|
|
60
83
|
|
|
61
84
|
### 2. 选择您的平台
|
|
62
85
|
|
|
63
|
-
|
|
86
|
+
如果这是您第一次发布,系统会提示您选择一个目标。请选择符合您要求的选项。
|
|
64
87
|
|
|
65
|
-

|
|
66
89
|
|
|
67
|
-
|
|
90
|
+
如果您选择自托管实例,系统会要求您输入其 URL。
|
|
68
91
|
|
|
69
92
|
### 3. 验证您的账户
|
|
70
93
|
|
|
71
|
-
|
|
94
|
+
对于初次连接,浏览器窗口将自动打开,以便您登录并授权 CLI。此步骤每个平台只需执行一次。访问令牌会保存在本地以备将来使用。
|
|
72
95
|
|
|
73
96
|
### 4. 确认
|
|
74
97
|
|
|
75
|
-
|
|
98
|
+
上传完成后,您的终端将显示一条成功消息,确认文档已上线。
|
|
76
99
|
|
|
77
100
|
```
|
|
78
101
|
✅ 文档发布成功!
|
|
@@ -80,28 +103,28 @@ aigne doc publish
|
|
|
80
103
|
|
|
81
104
|
## 在 CI/CD 环境中发布
|
|
82
105
|
|
|
83
|
-
|
|
106
|
+
要在 CI/CD 流水线等自动化工作流程中使用发布命令,您可以通过参数和环境变量提供必要信息来绕过交互式提示。
|
|
84
107
|
|
|
85
108
|
| 方法 | 名称 | 描述 |
|
|
86
109
|
|---|---|---|
|
|
87
|
-
| **参数** | `--appUrl` |
|
|
88
|
-
| **环境变量** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` |
|
|
110
|
+
| **参数** | `--appUrl` | 指定您的 Discuss Kit 实例的 URL。 |
|
|
111
|
+
| **环境变量** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | 提供访问令牌以跳过交互式登录过程。 |
|
|
89
112
|
|
|
90
|
-
以下是一个适用于 CI/CD
|
|
113
|
+
以下是一个适用于 CI/CD 脚本的非交互式发布命令示例:
|
|
91
114
|
|
|
92
|
-
```bash CI/CD
|
|
115
|
+
```bash CI/CD 示例 icon=lucide:workflow
|
|
93
116
|
export DOC_DISCUSS_KIT_ACCESS_TOKEN="your_access_token_here"
|
|
94
117
|
aigne doc publish --appUrl https://docs.mycompany.com
|
|
95
118
|
```
|
|
96
119
|
|
|
97
|
-
##
|
|
120
|
+
## 故障排除
|
|
98
121
|
|
|
99
|
-
|
|
122
|
+
如果您在发布过程中遇到问题,可能是由以下常见问题之一引起的。
|
|
100
123
|
|
|
101
|
-
-
|
|
124
|
+
- **连接错误**:CLI 可能会返回类似 `Unable to connect to: <URL>` 的错误消息。这可能是由网络问题、服务器暂时不可用或 URL 不正确引起的。请验证 URL 是否正确且服务器是否可达。
|
|
102
125
|
|
|
103
|
-
- **无效的网站 URL
|
|
126
|
+
- **无效的网站 URL**:命令可能会失败并显示消息 `The provided URL is not a valid website on ArcBlock platform`。目标 URL 必须是基于 ArcBlock 平台构建的网站。要托管您的文档,您可以运行自己的 Discuss Kit 实例。
|
|
104
127
|
|
|
105
|
-
-
|
|
128
|
+
- **缺少必需组件**:错误消息 `This website does not have required components for publishing` 表示目标网站没有安装 Discuss Kit 组件。请参阅 Discuss Kit 文档,将必要的组件添加到您的站点。
|
|
106
129
|
|
|
107
130
|
有关命令和选项的完整列表,请参阅 [CLI 命令参考](./cli-reference.md)。
|