@aigne/doc-smith 0.8.3 → 0.8.5

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.
Files changed (58) hide show
  1. package/.aigne/doc-smith/config.yaml +3 -3
  2. package/.aigne/doc-smith/preferences.yml +58 -12
  3. package/.aigne/doc-smith/upload-cache.yaml +600 -207
  4. package/CHANGELOG.md +22 -0
  5. package/README.md +77 -5
  6. package/agents/input-generator.mjs +12 -6
  7. package/agents/publish-docs.mjs +53 -4
  8. package/docs/_sidebar.md +1 -1
  9. package/docs/advanced-how-it-works.md +55 -60
  10. package/docs/advanced-how-it-works.zh.md +60 -65
  11. package/docs/advanced-quality-assurance.md +73 -38
  12. package/docs/advanced-quality-assurance.zh.md +73 -38
  13. package/docs/advanced.md +2 -14
  14. package/docs/advanced.zh.md +5 -17
  15. package/docs/changelog.md +41 -4
  16. package/docs/changelog.zh.md +77 -40
  17. package/docs/cli-reference.md +79 -13
  18. package/docs/cli-reference.zh.md +92 -26
  19. package/docs/configuration-interactive-setup.md +102 -49
  20. package/docs/configuration-interactive-setup.zh.md +102 -49
  21. package/docs/configuration-language-support.md +69 -39
  22. package/docs/configuration-language-support.zh.md +68 -38
  23. package/docs/configuration-llm-setup.md +25 -62
  24. package/docs/configuration-llm-setup.zh.md +25 -62
  25. package/docs/configuration-preferences.md +79 -67
  26. package/docs/configuration-preferences.zh.md +78 -67
  27. package/docs/configuration.md +122 -109
  28. package/docs/configuration.zh.md +130 -117
  29. package/docs/features-generate-documentation.md +44 -24
  30. package/docs/features-generate-documentation.zh.md +52 -32
  31. package/docs/features-publish-your-docs.md +41 -40
  32. package/docs/features-publish-your-docs.zh.md +50 -49
  33. package/docs/features-translate-documentation.md +73 -17
  34. package/docs/features-translate-documentation.zh.md +76 -20
  35. package/docs/features-update-and-refine.md +72 -21
  36. package/docs/features-update-and-refine.zh.md +80 -29
  37. package/docs/features.md +24 -28
  38. package/docs/features.zh.md +25 -29
  39. package/docs/getting-started.md +87 -38
  40. package/docs/getting-started.zh.md +88 -39
  41. package/docs/overview.md +17 -35
  42. package/docs/overview.zh.md +18 -36
  43. package/package.json +9 -8
  44. package/prompts/content-detail-generator.md +1 -0
  45. package/prompts/document/custom-code-block.md +101 -0
  46. package/prompts/document/d2-chart/rules.md +941 -1031
  47. package/prompts/document/detail-generator.md +7 -53
  48. package/tests/input-generator.test.mjs +2 -2
  49. package/tests/kroki-utils.test.mjs +88 -17
  50. package/utils/auth-utils.mjs +9 -2
  51. package/utils/blocklet.mjs +25 -6
  52. package/utils/constants.mjs +17 -1
  53. package/utils/deploy.mjs +404 -0
  54. package/utils/kroki-utils.mjs +22 -14
  55. package/utils/markdown-checker.mjs +1 -1
  56. package/utils/utils.mjs +3 -2
  57. package/prompts/document/d2-chart/diy-examples.md +0 -44
  58. package/prompts/document/d2-chart/shape-rules.md +0 -182
@@ -1,12 +1,8 @@
1
- ---
2
- labels: ["Reference"]
3
- ---
4
-
5
1
  # Generate Documentation
6
2
 
7
- The `aigne doc generate` command is the core function of DocSmith, designed to transform your source code into a comprehensive and well-structured documentation suite with a single command.
3
+ The `aigne doc generate` command is the core function of DocSmith, designed to transform your source code into a structured documentation suite with a single command.
8
4
 
9
- This process involves analyzing your codebase, planning a logical document structure, and then generating detailed content for each section. It's the primary way to create your documentation from scratch.
5
+ This process analyzes your codebase, plans a logical document structure, and then generates content for each section. It's the primary way to create your documentation from scratch.
10
6
 
11
7
  ## Your First Generation
12
8
 
@@ -16,9 +12,9 @@ To begin, navigate to your project's root directory and run the following comman
16
12
  aigne doc generate
17
13
  ```
18
14
 
19
- ### Smart Auto-Configuration
15
+ ### Automatic Configuration
20
16
 
21
- If you're running this command for the first time in a project, DocSmith will intelligently detect that no configuration exists. It will automatically launch an interactive setup wizard to guide you through the initial setup. This ensures you have a properly configured environment before generation begins.
17
+ If you're running this command for the first time in a project, DocSmith will detect that no configuration exists. It will automatically launch an interactive setup wizard to guide you through the initial setup. This ensures you have a properly configured environment before generation begins.
22
18
 
23
19
  ![Running the generate command for the first time triggers the setup wizard](https://docsmith.aigne.io/image-bin/uploads/0c45a32667c5250e54194a61d9495965.png)
24
20
 
@@ -40,43 +36,67 @@ Upon successful completion, your newly created documentation will be available i
40
36
 
41
37
  ## The Generation Process
42
38
 
43
- The `generate` command follows a clear, automated workflow to ensure consistent and high-quality results. The process can be visualized as follows:
39
+ The `generate` command follows an automated workflow to ensure consistent results. The process can be visualized as follows:
44
40
 
45
41
  ```d2
46
42
  direction: down
47
43
 
48
- start: "Start"
49
- run_cmd: "Run `aigne doc generate`"
50
- check_config: "Configuration exists?" {
44
+ start: "Start" {
45
+ shape: oval
46
+ }
47
+
48
+ run_cmd: "Run `aigne doc generate`" {
49
+ shape: rectangle
50
+ }
51
+
52
+ check_config: "Configuration Found?" {
51
53
  shape: diamond
52
54
  }
53
- interactive_setup: "Interactive Setup Wizard"
54
- plan_structure: "Analyze Code & Plan Structure"
55
- gen_content: "Generate Document Content"
56
- save_docs: "Save Documents to Output Directory"
57
- end: "End"
58
55
 
59
- start -> run_cmd -> check_config
56
+ interactive_setup: "Launch Interactive Setup Wizard" {
57
+ shape: rectangle
58
+ }
59
+
60
+ plan_structure: "1. Analyze Code & Plan Structure" {
61
+ shape: rectangle
62
+ }
63
+
64
+ gen_content: "2. Generate Document Content" {
65
+ shape: rectangle
66
+ }
67
+
68
+ save_docs: "3. Save Documents" {
69
+ shape: rectangle
70
+ }
71
+
72
+ end: "End" {
73
+ shape: oval
74
+ }
75
+
76
+ start -> run_cmd
77
+ run_cmd -> check_config
60
78
  check_config -> interactive_setup: "No"
61
79
  interactive_setup -> plan_structure
62
80
  check_config -> plan_structure: "Yes"
63
- plan_structure -> gen_content -> save_docs -> end
81
+ plan_structure -> gen_content
82
+ gen_content -> save_docs
83
+ save_docs -> end
64
84
  ```
65
85
 
66
- ## Fine-Tuning Your Generation
86
+ ## Command Options
67
87
 
68
- While the default `generate` command is sufficient for most use cases, you can use several options to control the generation process. These are particularly useful for regenerating content or refining the document structure.
88
+ While the default `generate` command is sufficient for most use cases, you can use several options to control the generation process. These are useful for regenerating content or refining the document structure.
69
89
 
70
90
  | Option | Description | Example |
71
91
  |---------------------|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
72
92
  | `--forceRegenerate` | Deletes all existing documents and regenerates them from scratch. Use this after making significant changes to your source code or configuration. | `aigne doc generate --forceRegenerate` |
73
93
  | `--feedback` | Provides high-level feedback to refine the overall document structure plan, such as adding, removing, or reorganizing sections. | `aigne doc generate --feedback "Add an API Reference section"` |
74
- | `--model` | Specifies a particular Large Language Model from AIGNE Hub to use for content generation, allowing you to switch between models easily. | `aigne doc generate --model claude:claude-3-5-sonnet` |
94
+ | `--model` | Specifies a particular Large Language Model from AIGNE Hub to use for content generation, allowing you to switch between models. | `aigne doc generate --model claude:claude-3-5-sonnet` |
75
95
 
76
96
  ## What's Next?
77
97
 
78
98
  Now that you have generated your initial documentation, your project will continue to evolve. To keep your documents synchronized with your code, you will need to update them. Proceed to the next section to learn how to make targeted changes and regenerate specific files.
79
99
 
80
100
  <x-card data-title="Update and Refine" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
81
- Discover how to intelligently update documents when your code changes or make specific improvements using feedback.
82
- </x-card>.
101
+ Discover how to update documents when your code changes or make specific improvements using feedback.
102
+ </x-card>
@@ -1,28 +1,24 @@
1
- ---
2
- labels: ["Reference"]
3
- ---
4
-
5
1
  # 生成文档
6
2
 
7
- `aigne doc generate` 命令是 DocSmith 的核心功能,旨在通过一个命令将您的源代码转换为内容全面、结构清晰的文档套件。
3
+ `aigne doc generate` 命令是 DocSmith 的核心功能,旨在通过一个命令将您的源代码转换为结构化的文档套件。
8
4
 
9
- 该过程包括分析您的代码库、规划合理的文档结构,然后为每个部分生成详细内容。这是从零开始创建文档的主要方式。
5
+ 该过程会分析您的代码库,规划逻辑文档结构,然后为每个部分生成内容。这是从零开始创建文档的主要方式。
10
6
 
11
7
  ## 首次生成
12
8
 
13
- 首先,请进入您项目的根目录并运行以下命令:
9
+ 首先,请导航至您项目的根目录并运行以下命令:
14
10
 
15
11
  ```bash
16
12
  aigne doc generate
17
13
  ```
18
14
 
19
- ### 智能自动配置
15
+ ### 自动配置
20
16
 
21
- 如果您首次在项目中运行此命令,DocSmith 将智能地检测到尚无配置。它会自动启动一个交互式设置向导,引导您完成初始设置。这能确保在生成开始前,您已拥有一个正确配置的环境。
17
+ 如果您首次在项目中运行此命令,DocSmith 会检测到尚无配置。它将自动启动交互式设置向导,引导您完成初始设置。这可以确保您在生成开始前拥有一个正确配置的环境。
22
18
 
23
19
  ![首次运行 generate 命令会触发设置向导](https://docsmith.aigne.io/image-bin/uploads/0c45a32667c5250e54194a61d9495965.png)
24
20
 
25
- 系统将询问您一系列问题以定义:
21
+ 系统会询问您一系列问题,用于定义:
26
22
  - 文档生成规则和风格
27
23
  - 目标受众
28
24
  - 主要语言和翻译语言
@@ -32,7 +28,7 @@ aigne doc generate
32
28
 
33
29
  配置完成后,DocSmith 会继续进行文档生成。
34
30
 
35
- ![DocSmith 分析您的代码、规划结构并生成每个文档](https://docsmith.aigne.io/image-bin/uploads/d0766c19380a02eb8a6f8ce86a838849.png)
31
+ ![DocSmith 会分析您的代码、规划结构并生成每个文档](https://docsmith.aigne.io/image-bin/uploads/d0766c19380a02eb8a6f8ce86a838849.png)
36
32
 
37
33
  成功完成后,您新创建的文档将位于您指定的输出目录中。
38
34
 
@@ -40,43 +36,67 @@ aigne doc generate
40
36
 
41
37
  ## 生成过程
42
38
 
43
- `generate` 命令遵循一个清晰、自动化的工作流程,以确保结果的一致性和高质量。该过程的可视化流程如下:
39
+ `generate` 命令遵循自动化工作流以确保结果的一致性。该过程可按如下方式可视化:
44
40
 
45
41
  ```d2
46
42
  direction: down
47
43
 
48
- start: "开始"
49
- run_cmd: "运行 `aigne doc generate`"
50
- check_config: "配置是否存在?" {
44
+ start: "开始" {
45
+ shape: oval
46
+ }
47
+
48
+ run_cmd: "运行 `aigne doc generate`" {
49
+ shape: rectangle
50
+ }
51
+
52
+ check_config: "找到配置?" {
51
53
  shape: diamond
52
54
  }
53
- interactive_setup: "交互式设置向导"
54
- plan_structure: "分析代码并规划结构"
55
- gen_content: "生成文档内容"
56
- save_docs: "将文档保存到输出目录"
57
- end: "结束"
58
55
 
59
- start -> run_cmd -> check_config
56
+ interactive_setup: "启动交互式设置向导" {
57
+ shape: rectangle
58
+ }
59
+
60
+ plan_structure: "1. 分析代码和规划结构" {
61
+ shape: rectangle
62
+ }
63
+
64
+ gen_content: "2. 生成文档内容" {
65
+ shape: rectangle
66
+ }
67
+
68
+ save_docs: "3. 保存文档" {
69
+ shape: rectangle
70
+ }
71
+
72
+ end: "结束" {
73
+ shape: oval
74
+ }
75
+
76
+ start -> run_cmd
77
+ run_cmd -> check_config
60
78
  check_config -> interactive_setup: "否"
61
79
  interactive_setup -> plan_structure
62
80
  check_config -> plan_structure: "是"
63
- plan_structure -> gen_content -> save_docs -> end
81
+ plan_structure -> gen_content
82
+ gen_content -> save_docs
83
+ save_docs -> end
64
84
  ```
65
85
 
66
- ## 微调生成过程
86
+ ## 命令选项
67
87
 
68
- 虽然默认的 `generate` 命令足以满足大多数使用场景,但您也可以使用一些选项来控制生成过程。这些选项在重新生成内容或优化文档结构时尤其有用。
88
+ 虽然默认的 `generate` 命令足以满足大多数用例,但您可以使用多个选项来控制生成过程。这些选项对于重新生成内容或优化文档结构非常有用。
69
89
 
70
- | 选项 | 描述 | 示例 |
90
+ | 选项 | 描述 | 示例 |
71
91
  |---------------------|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
72
- | `--forceRegenerate` | 删除所有现有文档并从头开始重新生成。在对源代码或配置进行重大更改后使用此选项。 | `aigne doc generate --forceRegenerate` |
73
- | `--feedback` | 提供高级反馈以优化整体文档结构规划,例如添加、删除或重组章节。 | `aigne doc generate --feedback "添加一个 API 参考部分"` |
74
- | `--model` | 指定 AIGNE Hub 中的特定大语言模型用于内容生成,让您可以轻松切换模型。 | `aigne doc generate --model claude:claude-3-5-sonnet` |
92
+ | `--forceRegenerate` | 删除所有现有文档并从头开始重新生成。在对源代码或配置进行重大更改后使用此选项。 | `aigne doc generate --forceRegenerate` |
93
+ | `--feedback` | 提供高层级反馈以优化整体文档结构规划,例如添加、删除或重组部分。 | `aigne doc generate --feedback "添加一个 API 参考部分"` |
94
+ | `--model` | 指定 AIGNE Hub 中的特定大型语言模型用于内容生成,允许您在不同模型之间切换。 | `aigne doc generate --model claude:claude-3-5-sonnet` |
75
95
 
76
- ## 下一步
96
+ ## 后续步骤
77
97
 
78
- 既然您已经生成了初始文档,您的项目还将继续迭代。为了使文档与代码保持同步,您需要更新文档。请继续阅读下一章节,了解如何进行针对性修改和重新生成特定文件。
98
+ 既然您已经生成了初始文档,您的项目将继续发展。为了使文档与代码保持同步,您需要更新它们。请继续阅读下一部分,了解如何进行有针对性的更改和重新生成特定文件。
79
99
 
80
100
  <x-card data-title="更新和优化" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
81
- 了解当代码发生变化时如何智能更新文档,或利用反馈进行特定改进。
82
- </x-card>.
101
+ 了解当代码发生变化时如何更新文档,或使用反馈进行特定改进。
102
+ </x-card>
@@ -1,50 +1,50 @@
1
- ---
2
- labels: ["Reference"]
3
- ---
4
-
5
1
  # Publish Your Docs
6
2
 
7
- Once your documentation is generated, the next step is to make it accessible online. AIGNE DocSmith simplifies this process with the `aigne doc publish` command, which uploads your content to a Discuss Kit platform, making it instantly available to your audience.
3
+ Once your documentation is generated, the next step is to make it accessible online. AIGNE DocSmith simplifies this process with the `aigne doc publish` command, which uploads your content to a Discuss Kit platform, making it available to your audience.
8
4
 
9
- This guide covers how to publish your documentation, whether you're using the free official platform or your own self-hosted instance.
5
+ This guide covers how to publish your documentation, whether you are using the official platform or your own website.
10
6
 
11
7
  ## The Publishing Process
12
8
 
13
9
  The `aigne doc publish` command initiates an interactive process that guides you through the necessary steps. The diagram below shows the typical workflow for publishing your documentation for the first time.
14
10
 
15
11
  ```d2
12
+ direction: down
16
13
  shape: sequence_diagram
17
14
 
18
- User; CLI; "Discuss Kit Platform"
19
-
20
- User -> CLI: runs `aigne doc publish`
21
-
22
- alt "First time or not configured"
23
- CLI -> User: "Prompt: Select platform"
24
- User -> CLI: "Selects Official or Self-Hosted"
25
- CLI -> User: "Opens browser for authentication"
26
- User -> "Discuss Kit Platform": "Logs in and authorizes"
27
- "Discuss Kit Platform" -> CLI: "Provides access token"
28
- CLI -> CLI: "Saves token for future use"
29
- end
30
-
31
- CLI -> "Discuss Kit Platform": "Uploads documentation & media"
32
- "Discuss Kit Platform" -> CLI: "Confirms success"
33
- CLI -> User: "✅ Documentation Published Successfully!"
15
+ User: { shape: c4-person }
16
+ CLI: { label: "AIGNE CLI" }
17
+ Browser: { label: "Browser" }
18
+ Platform: { label: "Discuss Kit Platform" }
19
+
20
+ User -> CLI: "aigne doc publish"
21
+
22
+ alt: "First-time publish or missing config" {
23
+ CLI -> User: "Select Platform\n(Official / Self-Hosted)"
24
+ User -> CLI: "Provides selection"
25
+ CLI -> Browser: "Opens authentication URL"
26
+ User -> Browser: "Logs in & authorizes"
27
+ Browser -> Platform: "Sends credentials"
28
+ Platform -> CLI: "Returns Access Token"
29
+ CLI -> CLI: "Saves Token for future use"
30
+ }
31
+
32
+ CLI -> Platform: "Uploads docs & media files"
33
+ Platform -> CLI: "Success response"
34
+ CLI -> User: "✅ Published Successfully!"
34
35
  ```
35
36
 
36
37
  ## Publishing Options
37
38
 
38
39
  You have two primary options for hosting your documentation, catering to different needs for visibility and control.
39
40
 
40
- <x-cards data-columns="2">
41
- <x-card data-title="Official Platform" data-icon="lucide:globe">
42
- Publish to docsmith.aigne.io, the official hosting platform. This option is free, ideal for open-source projects, and makes your documentation publicly accessible.
43
- </x-card>
44
- <x-card data-title="Self-Hosted Platform" data-icon="lucide:server">
45
- Publish to your own private instance of Discuss Kit. This gives you full control over who can access your documentation, making it suitable for internal or private projects.
46
- </x-card>
47
- </x-cards>
41
+ ### Official Platform
42
+
43
+ Publish to [docsmith.aigne.io](https://docsmith.aigne.io), the official hosting platform. This option is free, makes your documentation publicly accessible, and is recommended for open-source projects.
44
+
45
+ ### Your Own Website
46
+
47
+ Publish to your own website by running a Discuss Kit instance. This gives you full control over who can access your documentation, making it suitable for internal or private projects. You can get started with running your own Discuss Kit from the [official store](https://www.arcblock.io/store/z8iZhf67n368m2k5a9fXvCL778jAnf3e5n2b).
48
48
 
49
49
  ## Step-by-Step Guide
50
50
 
@@ -60,11 +60,11 @@ aigne doc publish
60
60
 
61
61
  ### 2. Choose Your Platform
62
62
 
63
- If you haven't configured a publishing destination before, you will be prompted to choose between the official platform and a self-hosted one. Select the option that best suits your needs.
63
+ If you have not configured a publishing destination before, you will be prompted to choose between the official platform and a self-hosted one. Select the option that best suits your needs.
64
64
 
65
65
  ![Choose between the official platform or a self-hosted instance](https://docsmith.aigne.io/image-bin/uploads/9fd929060b5abe13d03cf5eb7aea85aa.png)
66
66
 
67
- If you select the self-hosted option, you will be asked to enter the URL for your Discuss Kit instance.
67
+ If you select your own website, you will be asked to enter the URL for your Discuss Kit instance.
68
68
 
69
69
  ### 3. Authenticate Your Account
70
70
 
@@ -82,17 +82,18 @@ Once the upload is complete, you will see a success message in your terminal, an
82
82
 
83
83
  For automated workflows, you can bypass the interactive prompts by using command-line arguments or environment variables.
84
84
 
85
- | Method | Name | Description | Example |
86
- |---|---|---|---|
87
- | **Argument** | `--appUrl` | Specifies the URL of your self-hosted Discuss Kit instance directly. | `aigne doc publish --appUrl https://docs.mycompany.com` |
88
- | **Env Var** | `DOC_DISCUSS_KIT_URL` | Sets the target platform URL, overriding any other configuration. | `export DOC_DISCUSS_KIT_URL=...` |
89
- | **Env Var** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | Provides the access token directly, skipping the interactive login. | `export DOC_DISCUSS_KIT_ACCESS_TOKEN=...` |
85
+ | Method | Name | Description | Example |
86
+ | ---------- | ------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
87
+ | **Argument** | `--appUrl` | Specifies the URL of your Discuss Kit instance directly. | `aigne doc publish --appUrl https://docs.mycompany.com` |
88
+ | **Env Var** | `DOC_DISCUSS_KIT_URL` | Sets the target platform URL, overriding any other configuration. | `export DOC_DISCUSS_KIT_URL=...` |
89
+ | **Env Var** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | Provides the access token directly, skipping the interactive login. | `export DOC_DISCUSS_KIT_ACCESS_TOKEN=...` |
90
90
 
91
91
  ## Troubleshooting
92
92
 
93
93
  If you encounter issues during the publishing process, here are some common causes and their solutions:
94
94
 
95
- - **Invalid URL or Connection Error**: This often happens if the provided URL for a self-hosted instance is incorrect or the server is not reachable. Double-check the URL and your network connection.
96
- - **Missing Required Components**: The destination website must have the Discuss Kit component installed to host the documentation. If it's missing, the CLI will return an error with guidance on how to install it.
95
+ - **Connection Error**: This can happen if the provided URL for your own instance is incorrect or the server is not reachable. Check the URL and your network connection.
96
+ - **Invalid Website URL**: The provided URL is not a valid website on the ArcBlock platform. To host your documentation, you need a website running on this platform. You can start by visiting the [Discuss Kit Store](https://www.arcblock.io/store/z8iZhf67n368m2k5a9fXvCL778jAnf3e5n2b).
97
+ - **Missing Required Components**: The destination website must have the Discuss Kit component installed to host the documentation. If it is missing, the CLI will return an error with guidance on how to add the component. You can find instructions in the [Discuss Kit documentation](https://www.arcblock.io/docs/web3-kit/en/discuss-kit).
97
98
 
98
- For a complete list of commands and options, please refer to the [CLI Command Reference](./cli-reference.md).
99
+ For a complete list of commands and options, refer to the [CLI Command Reference](./cli-reference.md).
@@ -1,50 +1,50 @@
1
- ---
2
- labels: ["Reference"]
3
- ---
1
+ # 发布你的文档
4
2
 
5
- # 发布文档
3
+ 文档生成后,下一步是使其可以在线访问。AIGNE DocSmith 通过 `aigne doc publish` 命令简化了这一过程,该命令会将你的内容上传到 Discuss Kit 平台,供你的受众访问。
6
4
 
7
- 文档生成后,下一步是将其发布到线上。AIGNE DocSmith 通过 `aigne doc publish` 命令简化了这一过程,该命令会将您的内容上传到 Discuss Kit 平台,使其即时对您的受众可用。
8
-
9
- 本指南将介绍如何发布您的文档,无论您使用的是免费的官方平台还是自托管的实例。
5
+ 本指南将介绍如何发布文档,无论你是使用官方平台还是自己的网站。
10
6
 
11
7
  ## 发布流程
12
8
 
13
- `aigne doc publish` 命令会启动一个交互式流程,引导您完成必要的步骤。下图展示了首次发布文档的典型工作流程。
9
+ `aigne doc publish` 命令会启动一个交互式流程,引导你完成必要的步骤。下图展示了首次发布文档的典型工作流程。
14
10
 
15
11
  ```d2
12
+ direction: down
16
13
  shape: sequence_diagram
17
14
 
18
- 用户; CLI; "Discuss Kit 平台"
15
+ User: { shape: c4-person }
16
+ CLI: { label: "AIGNE CLI" }
17
+ Browser: { label: "Browser" }
18
+ Platform: { label: "Discuss Kit Platform" }
19
+
20
+ User -> CLI: "aigne doc publish"
21
+
22
+ alt: "首次发布或缺少配置" {
23
+ CLI -> User: "选择平台\n(官方/自托管)"
24
+ User -> CLI: "提供选择"
25
+ CLI -> Browser: "打开认证 URL"
26
+ User -> Browser: "登录并授权"
27
+ Browser -> Platform: "发送凭证"
28
+ Platform -> CLI: "返回访问令牌"
29
+ CLI -> CLI: "保存令牌以备将来使用"
30
+ }
31
+
32
+ CLI -> Platform: "上传文档和媒体文件"
33
+ Platform -> CLI: "成功响应"
34
+ CLI -> User: "✅ 发布成功!"
35
+ ```
19
36
 
20
- 用户 -> CLI: 运行 `aigne doc publish`
37
+ ## 发布选项
21
38
 
22
- alt "首次使用或未配置"
23
- CLI -> 用户: "提示:选择平台"
24
- 用户 -> CLI: "选择官方或自托管"
25
- CLI -> 用户: "打开浏览器进行身份验证"
26
- 用户 -> "Discuss Kit 平台": "登录并授权"
27
- "Discuss Kit 平台" -> CLI: "提供访问令牌"
28
- CLI -> CLI: "保存令牌供将来使用"
29
- end
39
+ 你有两种主要选项来托管文档,以满足对可见性和控制的不同需求。
30
40
 
31
- CLI -> "Discuss Kit 平台": "上传文档和媒体文件"
32
- "Discuss Kit 平台" -> CLI: "确认成功"
33
- CLI -> 用户: "✅ 文档发布成功!"
34
- ```
41
+ ### 官方平台
35
42
 
36
- ## 发布选项
43
+ 发布到官方托管平台 [docsmith.aigne.io](https://docsmith.aigne.io)。此选项免费,可使你的文档公开访问,推荐用于开源项目。
37
44
 
38
- 您有两种主要选项来托管您的文档,以满足不同的可见性和控制需求。
45
+ ### 你自己的网站
39
46
 
40
- <x-cards data-columns="2">
41
- <x-card data-title="官方平台" data-icon="lucide:globe">
42
- 发布到官方托管平台 docsmith.aigne.io。该选项免费,非常适合开源项目,并能让您的文档公开访问。
43
- </x-card>
44
- <x-card data-title="自托管平台" data-icon="lucide:server">
45
- 发布到您自己的 Discuss Kit 私有实例。这使您可以完全控制谁可以访问您的文档,适合内部或私有项目。
46
- </x-card>
47
- </x-cards>
47
+ 通过运行 Discuss Kit 实例发布到你自己的网站。这使你可以完全控制谁能访问你的文档,适合内部或私有项目。你可以从[官方商店](https://www.arcblock.io/store/z8iZhf67n368m2k5a9fXvCL778jAnf3e5n2b)开始运行你自己的 Discuss Kit。
48
48
 
49
49
  ## 分步指南
50
50
 
@@ -52,27 +52,27 @@ CLI -> 用户: "✅ 文档发布成功!"
52
52
 
53
53
  ### 1. 运行发布命令
54
54
 
55
- 在终端中,导航到您项目的根目录并运行以下命令:
55
+ 在终端中导航到项目根目录,并运行以下命令:
56
56
 
57
57
  ```bash
58
58
  aigne doc publish
59
59
  ```
60
60
 
61
- ### 2. 选择您的平台
61
+ ### 2. 选择你的平台
62
62
 
63
- 如果您之前没有配置过发布目标,系统将提示您在官方平台和自托管平台之间进行选择。请选择最适合您需求的选项。
63
+ 如果你之前没有配置过发布目的地,系统将提示你在官方平台和自托管平台之间进行选择。请选择最适合你需求的选项。
64
64
 
65
65
  ![在官方平台或自托管实例之间选择](https://docsmith.aigne.io/image-bin/uploads/9fd929060b5abe13d03cf5eb7aea85aa.png)
66
66
 
67
- 如果您选择自托管选项,系统将要求您输入您的 Discuss Kit 实例的 URL。
67
+ 如果你选择自己的网站,系统将要求你输入 Discuss Kit 实例的 URL。
68
68
 
69
- ### 3. 验证您的账户
69
+ ### 3. 认证你的账户
70
70
 
71
- 首次连接到新平台时,DocSmith 会自动打开一个浏览器窗口,供您登录并授权 CLI。这是一个一次性步骤;您的访问令牌将被保存在本地,用于将来向该平台进行的所有发布。
71
+ 首次连接到新平台时,DocSmith 会自动打开浏览器窗口,以便你登录并授权 CLI。这是一个一次性步骤;你的访问令牌将保存在本地,用于将来对该平台的所有发布操作。
72
72
 
73
73
  ### 4. 确认
74
74
 
75
- 上传完成后,您将在终端中看到一条成功消息,您的文档即已上线。
75
+ 上传完成后,你将在终端看到一条成功消息,你的文档即已上线。
76
76
 
77
77
  ```
78
78
  ✅ 文档发布成功!
@@ -80,19 +80,20 @@ aigne doc publish
80
80
 
81
81
  ## 在 CI/CD 环境中发布
82
82
 
83
- 对于自动化工作流,您可以通过使用命令行参数或环境变量来绕过交互式提示。
83
+ 对于自动化工作流,你可以使用命令行参数或环境变量来绕过交互式提示。
84
84
 
85
- | 方法 | 名称 | 描述 | 示例 |
86
- |---|---|---|---|
87
- | **参数** | `--appUrl` | 直接指定您自托管的 Discuss Kit 实例的 URL。 | `aigne doc publish --appUrl https://docs.mycompany.com` |
88
- | **环境变量** | `DOC_DISCUSS_KIT_URL` | 设置目标平台 URL,覆盖任何其他配置。 | `export DOC_DISCUSS_KIT_URL=...` |
89
- | **环境变量** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | 直接提供访问令牌,跳过交互式登录。 | `export DOC_DISCUSS_KIT_ACCESS_TOKEN=...` |
85
+ | Method | Name | Description | Example |
86
+ | ---------- | ------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
87
+ | **Argument** | `--appUrl` | 直接指定你的 Discuss Kit 实例的 URL。 | `aigne doc publish --appUrl https://docs.mycompany.com` |
88
+ | **Env Var** | `DOC_DISCUSS_KIT_URL` | 设置目标平台 URL,覆盖任何其他配置。 | `export DOC_DISCUSS_KIT_URL=...` |
89
+ | **Env Var** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | 直接提供访问令牌,跳过交互式登录。 | `export DOC_DISCUSS_KIT_ACCESS_TOKEN=...` |
90
90
 
91
91
  ## 故障排除
92
92
 
93
- 如果您在发布过程中遇到问题,以下是一些常见原因及其解决方案:
93
+ 如果你在发布过程中遇到问题,以下是一些常见原因及其解决方案:
94
94
 
95
- - **无效的 URL 或连接错误**:这通常发生在为自托管实例提供的 URL 不正确或服务器无法访问时。请仔细检查 URL 和您的网络连接。
96
- - **缺少必需组件**:目标网站必须安装 Discuss Kit 组件才能托管文档。如果缺少该组件,CLI 将返回错误并提供安装指导。
95
+ - **连接错误**:如果提供的自有实例 URL 不正确或服务器无法访问,可能会发生此问题。请检查 URL 和你的网络连接。
96
+ - **无效的网站 URL**:提供的 URL 不是 ArcBlock 平台上的有效网站。要托管你的文档,你需要一个在该平台上运行的网站。你可以从访问 [Discuss Kit 商店](https://www.arcblock.io/store/z8iZhf67n368m2k5a9fXvCL778jAnf3e5n2b) 开始。
97
+ - **缺少必需组件**:目标网站必须安装 Discuss Kit 组件才能托管文档。如果缺少该组件,CLI 将返回错误并提供有关如何添加该组件的指导。你可以在 [Discuss Kit 文档](https://www.arcblock.io/docs/web3-kit/en/discuss-kit) 中找到相关说明。
97
98
 
98
- 有关命令和选项的完整列表,请参阅 [CLI 命令参考](./cli-reference.md)。
99
+ 如需完整的命令和选项列表,请参阅 [CLI 命令参考](./cli-reference.md)。