@aigne/doc-smith 0.8.12-beta.6 → 0.8.12-beta.8
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 +1 -1
- package/.aigne/doc-smith/history.yaml +37 -0
- package/.aigne/doc-smith/media-description.yaml +91 -0
- package/.aigne/doc-smith/preferences.yml +12 -0
- package/.aigne/doc-smith/upload-cache.yaml +36 -69
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +24 -0
- package/agents/clear/choose-contents.mjs +14 -1
- package/agents/clear/clear-media-description.mjs +129 -0
- package/agents/clear/index.yaml +3 -1
- package/agents/evaluate/code-snippet.mjs +28 -24
- package/agents/evaluate/document-structure.yaml +0 -4
- package/agents/evaluate/document.yaml +1 -5
- package/agents/generate/index.yaml +1 -0
- package/agents/generate/update-document-structure.yaml +9 -3
- package/agents/history/view.mjs +5 -2
- package/agents/init/index.mjs +10 -0
- package/agents/media/batch-generate-media-description.yaml +44 -0
- package/agents/media/generate-media-description.yaml +47 -0
- package/agents/media/load-media-description.mjs +238 -0
- package/agents/update/generate-document.yaml +10 -4
- package/agents/update/index.yaml +1 -0
- package/agents/update/update-document-detail.yaml +9 -3
- package/agents/update/user-review-document.mjs +2 -1
- package/agents/utils/load-sources.mjs +103 -53
- package/aigne.yaml +6 -0
- package/assets/report-template/report.html +34 -34
- package/docs/configuration-initial-setup.md +74 -55
- package/docs/configuration.ja.md +59 -86
- package/docs/configuration.md +59 -86
- package/docs/configuration.zh-TW.md +59 -86
- package/docs/configuration.zh.md +59 -86
- package/docs/getting-started.ja.md +43 -24
- package/docs/getting-started.md +29 -10
- package/docs/getting-started.zh-TW.md +42 -23
- package/docs/getting-started.zh.md +39 -20
- package/docs/guides-cleaning-up.ja.md +16 -15
- package/docs/guides-cleaning-up.md +19 -17
- package/docs/guides-cleaning-up.zh-TW.md +16 -15
- package/docs/guides-cleaning-up.zh.md +12 -11
- package/docs/guides-evaluating-documents.md +70 -29
- package/docs/guides-generating-documentation.ja.md +34 -32
- package/docs/guides-generating-documentation.md +59 -119
- package/docs/guides-generating-documentation.zh-TW.md +34 -32
- package/docs/guides-generating-documentation.zh.md +30 -28
- package/docs/guides-interactive-chat.md +34 -26
- package/docs/guides-managing-history.ja.md +17 -20
- package/docs/guides-managing-history.md +19 -17
- package/docs/guides-managing-history.zh-TW.md +18 -21
- package/docs/guides-managing-history.zh.md +13 -16
- package/docs/guides-publishing-your-docs.md +40 -35
- package/docs/guides-translating-documentation.ja.md +17 -17
- package/docs/guides-translating-documentation.md +39 -34
- package/docs/guides-translating-documentation.zh-TW.md +21 -21
- package/docs/guides-translating-documentation.zh.md +18 -18
- package/docs/guides-updating-documentation.ja.md +35 -35
- package/docs/guides-updating-documentation.md +11 -9
- package/docs/guides-updating-documentation.zh-TW.md +27 -27
- package/docs/guides-updating-documentation.zh.md +26 -26
- package/docs/overview.ja.md +13 -13
- package/docs/overview.md +2 -2
- package/docs/overview.zh-TW.md +19 -19
- package/docs/overview.zh.md +16 -16
- package/docs/release-notes.md +60 -27
- package/package.json +2 -1
- package/prompts/common/afs/afs-tools-usage.md +5 -0
- package/prompts/common/afs/use-afs-instruction.md +1 -0
- package/prompts/detail/generate/system-prompt.md +0 -13
- package/prompts/detail/generate/user-prompt.md +7 -0
- package/prompts/detail/update/system-prompt.md +1 -2
- package/prompts/detail/update/user-prompt.md +7 -0
- package/prompts/evaluate/document-structure.md +6 -7
- package/prompts/evaluate/document.md +16 -25
- package/prompts/media/media-description/system-prompt.md +35 -0
- package/prompts/media/media-description/user-prompt.md +8 -0
- package/prompts/structure/generate/system-prompt.md +0 -19
- package/prompts/structure/generate/user-prompt.md +22 -1
- package/prompts/structure/update/system-prompt.md +0 -17
- package/prompts/structure/update/user-prompt.md +24 -0
- package/tests/agents/history/view.test.mjs +97 -0
- package/tests/utils/history-utils.test.mjs +125 -97
- package/utils/constants/index.mjs +0 -107
- package/utils/file-utils.mjs +42 -1
- package/utils/history-utils.mjs +3 -3
- package/agents/update/fs-tools/glob.mjs +0 -184
- package/agents/update/fs-tools/grep.mjs +0 -317
- package/agents/update/fs-tools/read-file.mjs +0 -309
- package/media.md +0 -19
- package/tests/agents/update/fs-tools/glob.test.mjs +0 -438
- package/tests/agents/update/fs-tools/grep.test.mjs +0 -279
- package/tests/agents/update/fs-tools/read-file.test.mjs +0 -549
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Publishing Your Docs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
After generating your documentation, the next step is to make it accessible online. This guide provides a systematic procedure for publishing your documentation using the `aigne doc publish` command.
|
|
4
4
|
|
|
5
5
|
## The Publish Command
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The `aigne doc publish` command uploads your generated documentation files to a web service, making them available to your audience through a web browser.
|
|
8
8
|
|
|
9
|
-
You can execute the command using its full name or its
|
|
9
|
+
You can execute the command using its full name or one of its aliases for convenience.
|
|
10
10
|
|
|
11
|
-
```bash
|
|
11
|
+
```bash Command Execution icon=lucide:terminal
|
|
12
12
|
# Full command
|
|
13
13
|
aigne doc publish
|
|
14
14
|
|
|
@@ -17,62 +17,67 @@ aigne doc pub
|
|
|
17
17
|
aigne doc p
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
When
|
|
20
|
+
When this command is run for the first time, it initiates an interactive prompt to guide you through selecting a publishing platform.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+

|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
## Publishing Destinations
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
The tool provides several destinations for hosting your documentation. The interactive setup will present the following choices.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
### Option 1: DocSmith Cloud
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
- **Cost:** Free.
|
|
32
|
-
- **Outcome:** Your documents will be publicly available at a URL provided upon successful publication.
|
|
30
|
+
This option publishes your documentation to `docsmith.aigne.io`, a free hosting service.
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
* **Intended Use**: This method is suitable for open-source projects or any documentation that is intended for public access.
|
|
33
|
+
* **Cost**: Free.
|
|
34
|
+
* **Outcome**: Your documentation will be publicly available at a URL provided after the publishing process is complete.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
### Option 2: Your Existing Website
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
- **Cost:** Requires your own hosting infrastructure.
|
|
40
|
-
- **Setup:**
|
|
41
|
-
1. Select this option in the prompt.
|
|
42
|
-
2. You will be asked to enter the URL of your website (e.g., `https://docs.your-company.com`).
|
|
43
|
-
3. To set up your own documentation website, you can get a Discuss Kit instance from the official store: [https://www.web3kit.rocks/discuss-kit](https://www.web3kit.rocks/discuss-kit).
|
|
38
|
+
This option allows you to publish documentation to a website you already own and manage. It requires you to operate your own instance of Discuss Kit.
|
|
44
39
|
|
|
45
|
-
|
|
40
|
+
* **Intended Use**: This is for integrating documentation directly into an existing company website, product portal, or personal domain.
|
|
41
|
+
* **Requirements**: You must have your own hosting infrastructure and a running instance of Discuss Kit.
|
|
42
|
+
* **Procedure**:
|
|
43
|
+
1. Select the "Your existing website" option from the interactive prompt.
|
|
44
|
+
2. When prompted, enter the full URL of your website (e.g., `https://docs.your-company.com`).
|
|
45
|
+
3. To set up your own documentation website, you can obtain a Discuss Kit instance from the official store: [https://www.web3kit.rocks/discuss-kit](https://www.web3kit.rocks/discuss-kit). Discuss Kit is a non-open-source service that provides the necessary backend for hosting.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
### Option 3: New Website
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
- **Cost:** This is a paid service.
|
|
51
|
-
- **Process:** The command will guide you through the necessary steps to deploy and configure a new Discuss Kit instance. If you have started this process before, you will also see an option to resume your previous setup.
|
|
49
|
+
This option assists you in setting up a new, dedicated website for your documentation.
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
* **Intended Use**: This is for users who need a standalone documentation portal but do not have an existing website.
|
|
52
|
+
* **Cost**: This is a paid service.
|
|
53
|
+
* **Procedure**: The command-line interface will guide you through the process of deploying and configuring a new Discuss Kit instance. If you have previously started this process, an option to resume the setup will also be available.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
## Automated Publishing
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
For automated environments, such as a Continuous Integration/Continuous Deployment (CI/CD) pipeline, you can bypass the interactive prompt by specifying the destination URL directly.
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
Use the `--appUrl` flag with the command to define the publishing target.
|
|
60
|
+
|
|
61
|
+
```bash Direct Publishing Example icon=lucide:terminal
|
|
61
62
|
aigne doc publish --appUrl https://docs.your-company.com
|
|
62
63
|
```
|
|
63
64
|
|
|
64
|
-
Once you
|
|
65
|
+
Once you publish to a specific URL for the first time (either through the interactive prompt or the `--appUrl` flag), the tool saves this URL to your local configuration file. Subsequent executions of `aigne doc publish` will automatically use the saved URL, streamlining the update process.
|
|
65
66
|
|
|
66
67
|
## Troubleshooting
|
|
67
68
|
|
|
68
69
|
### Authorization Errors
|
|
69
70
|
|
|
70
|
-
If
|
|
71
|
+
If the publishing process fails with an error message that includes "401" or "403," it signifies an issue with your authentication token. The token may be invalid, expired, or lack the required permissions.
|
|
71
72
|
|
|
72
|
-
To resolve this,
|
|
73
|
+
To resolve this, reset your local configuration and credentials by running the `clear` command:
|
|
73
74
|
|
|
74
|
-
```bash
|
|
75
|
+
```bash Clear Configuration icon=lucide:terminal
|
|
75
76
|
aigne doc clear
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
After
|
|
79
|
+
After the command completes, run `aigne doc publish` again. You will be prompted to re-authenticate and configure your publishing destination.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
After successfully publishing your documentation, you may need to update it as your project evolves. For instructions on this process, please see the [Updating Documentation](./guides-updating-documentation.md) guide.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# ドキュメントの翻訳
|
|
2
2
|
|
|
3
|
-
このガイドでは、`aigne doc translate`
|
|
3
|
+
このガイドでは、`aigne doc translate` コマンドを使用して、生成されたドキュメントを多言語に翻訳する方法について説明します。このプロセスでは AI を使用して、翻訳が文脈を認識し、技術的な正確性を維持するようにします。
|
|
4
4
|
|
|
5
5
|
このツールは12の言語をサポートしており、世界中のオーディエンスにリーチすることができます。ソースドキュメントの主要言語は、利用可能な翻訳言語のリストから自動的に除外されます。
|
|
6
6
|
|
|
7
7
|
## `translate` コマンド
|
|
8
8
|
|
|
9
|
-
`aigne doc translate`
|
|
9
|
+
`aigne doc translate` コマンドは、既存のドキュメントファイルの翻訳を生成するために使用されます。対話形式で実行して、翻訳したいドキュメントと言語を選択することも、自動化されたワークフローのためにコマンドラインフラグを使用してこれらのオプションを直接指定することもできます。
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### 対話モード
|
|
12
12
|
|
|
13
13
|
ガイド付きのエクスペリエンスを利用するには、引数なしでコマンドを実行します。
|
|
14
14
|
|
|
@@ -18,21 +18,21 @@ aigne doc translate
|
|
|
18
18
|
|
|
19
19
|
実行されると、ツールは以下の手順を実行します。
|
|
20
20
|
1. 既存のドキュメントをスキャンします。
|
|
21
|
-
2.
|
|
22
|
-
3.
|
|
23
|
-
4.
|
|
24
|
-
5.
|
|
21
|
+
2. リストから翻訳したい特定のドキュメントを選択するように求めます。
|
|
22
|
+
3. 翻訳の対象言語を選択するように求めます。以前に選択した言語は、便宜上、事前にチェックされています。
|
|
23
|
+
4. 選択された各ドキュメントと言語のペアに対して翻訳プロセスを開始します。
|
|
24
|
+
5. 翻訳されたファイルを同じディレクトリに保存します。新しいファイルは、元のファイル名に言語コードを追加して命名されます(例:`overview.md` の中国語翻訳は `overview.zh.md` になります)。
|
|
25
25
|
|
|
26
26
|
### コマンドラインオプション
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
非対話的な使用やスクリプト作成のために、以下のコマンドラインフラグを使用して翻訳プロセスを制御できます。
|
|
29
29
|
|
|
30
30
|
<x-field-group>
|
|
31
31
|
<x-field data-name="--docs" data-type="array<string>">
|
|
32
|
-
<x-field-desc markdown
|
|
32
|
+
<x-field-desc markdown>翻訳する1つ以上のドキュメントパスを指定します。指定しない場合、ツールは対話モードに入り、利用可能なドキュメントのリストから選択できるようになります。</x-field-desc>
|
|
33
33
|
</x-field>
|
|
34
34
|
<x-field data-name="--langs" data-type="array<string>">
|
|
35
|
-
<x-field-desc markdown
|
|
35
|
+
<x-field-desc markdown>1つ以上のターゲット言語コード(例:`zh`、`ja`)を指定します。省略した場合、対話形式で言語を選択するように求められます。</x-field-desc>
|
|
36
36
|
</x-field>
|
|
37
37
|
<x-field data-name="--glossary" data-type="string">
|
|
38
38
|
<x-field-desc markdown>用語集ファイルへのパス(例:`@path/to/glossary.md`)を提供します。これにより、特定の技術用語がすべてのドキュメントで一貫して翻訳されるようになります。</x-field-desc>
|
|
@@ -46,13 +46,13 @@ aigne doc translate
|
|
|
46
46
|
|
|
47
47
|
#### 1. 特定のドキュメントを複数の言語に翻訳する
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
対話プロンプトなしで `overview.md` と `examples.md` を中国語(`zh`)と日本語(`ja`)に翻訳するには:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
#### 2.
|
|
55
|
+
#### 2. 用語集を使用して一貫した用語を確保する
|
|
56
56
|
|
|
57
57
|
技術用語が正しく翻訳されるように、用語集ファイルを提供します。これは、ブランド名や専門用語の一貫性を維持するのに役立ちます。
|
|
58
58
|
|
|
@@ -60,9 +60,9 @@ aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
|
60
60
|
aigne doc translate --glossary @./glossary.md
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
#### 3.
|
|
63
|
+
#### 3. フィードバックを提供して翻訳スタイルを洗練させる
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
フィードバックを提供することで、翻訳スタイルをガイドできます。例えば、よりフォーマルなトーンをリクエストするには:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
aigne doc translate --feedback "Use a formal, technical tone for all translations."
|
|
@@ -88,8 +88,8 @@ aigne doc translate --feedback "Use a formal, technical tone for all translation
|
|
|
88
88
|
| イタリア語 | `it` |
|
|
89
89
|
| アラビア語 | `ar` |
|
|
90
90
|
|
|
91
|
-
##
|
|
91
|
+
## 概要
|
|
92
92
|
|
|
93
|
-
`translate`
|
|
93
|
+
`translate` コマンドは、ドキュメントをローカライズするための構造化された方法を提供します。対話モードを使用してガイド付きの翻訳を行ったり、コマンドラインオプションを使用して自動化されたワークフローを構築したりできます。用語集やフィードバックなどの機能を使用することで、翻訳コンテンツの品質と一貫性を維持するのに役立ちます。
|
|
94
94
|
|
|
95
|
-
ドキュメントを翻訳した後、[ドキュメントの公開](./guides-publishing-your-docs.md)
|
|
95
|
+
ドキュメントを翻訳した後、[ドキュメントの公開](./guides-publishing-your-docs.md)に進むことができます。
|
|
@@ -2,43 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
This guide provides instructions on how to translate your generated documentation into multiple languages using the `aigne doc translate` command. The process uses AI to ensure translations are contextually aware and maintain technical accuracy.
|
|
4
4
|
|
|
5
|
-
The tool supports 12 languages, allowing you to
|
|
5
|
+
The tool supports 12 languages, such as Chinese, Japanese, and German, allowing you to make your documentation accessible to a global audience. The primary language of your source documents is automatically excluded from the list of available translation languages.
|
|
6
6
|
|
|
7
7
|
## The `translate` Command
|
|
8
8
|
|
|
9
|
-
The `aigne doc translate` command
|
|
9
|
+
The `aigne doc translate` command generates translations for your existing documentation files. You can run it in an interactive mode for a step-by-step process or specify options directly on the command line for faster, automated workflows.
|
|
10
10
|
|
|
11
11
|
### Interactive Mode
|
|
12
12
|
|
|
13
|
-
For a guided experience, run the command without any arguments
|
|
13
|
+
For a guided experience, run the command without any arguments. This is the recommended approach for new users.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
aigne doc translate
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
When
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
When you run this command, the tool will guide you through the following steps:
|
|
20
|
+
|
|
21
|
+
1. **Select Documents:** You will be prompted to choose the specific documents you wish to translate from a list of all available files in your project.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
2. **Select Languages:** Next, you will be asked to select the target languages for translation. Any languages you have used before will be pre-selected to save time.
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
3. **Process and Save:** The tool begins the translation process. Once complete, the translated files are saved in the same directory as the original files. The new files are named by adding a language code to the original filename. For example, a Chinese translation of `overview.md` will be saved as `overview.zh.md`.
|
|
25
30
|
|
|
26
31
|
### Command-Line Options
|
|
27
32
|
|
|
28
|
-
For non-interactive use or scripting, you can use
|
|
33
|
+
For non-interactive use or scripting, you can use command-line flags to control the translation process. This method is efficient when you already know which files and languages you need.
|
|
29
34
|
|
|
30
35
|
<x-field-group>
|
|
31
36
|
<x-field data-name="--docs" data-type="array<string>">
|
|
32
|
-
<x-field-desc markdown>Specify one or more document paths to translate. If not
|
|
37
|
+
<x-field-desc markdown>Specify one or more document paths to translate. If this flag is not used, the tool will start in interactive mode to let you select from a list of available documents.</x-field-desc>
|
|
33
38
|
</x-field>
|
|
34
39
|
<x-field data-name="--langs" data-type="array<string>">
|
|
35
|
-
<x-field-desc markdown>Specify one or more target language codes (e.g., `zh`, `ja`). If omitted, you will be prompted to select languages interactively.</x-field-desc>
|
|
40
|
+
<x-field-desc markdown>Specify one or more target language codes (e.g., `zh`, `ja`, `de`). If omitted, you will be prompted to select languages interactively.</x-field-desc>
|
|
36
41
|
</x-field>
|
|
37
42
|
<x-field data-name="--glossary" data-type="string">
|
|
38
|
-
<x-field-desc markdown>Provide a path to a glossary file (e.g., `@path/to/glossary.md`). This ensures that specific technical terms are translated consistently across all documents.</x-field-desc>
|
|
43
|
+
<x-field-desc markdown>Provide a path to a glossary file (e.g., `@path/to/glossary.md`). This ensures that specific technical terms, brand names, or acronyms are translated consistently across all documents.</x-field-desc>
|
|
39
44
|
</x-field>
|
|
40
45
|
<x-field data-name="--feedback" data-type="string">
|
|
41
|
-
<x-field-desc markdown>Provide specific instructions
|
|
46
|
+
<x-field-desc markdown>Provide specific instructions to guide the AI's translation style. For example, you can ask for a more formal tone or specify how to handle certain phrases.</x-field-desc>
|
|
42
47
|
</x-field>
|
|
43
48
|
</x-field-group>
|
|
44
49
|
|
|
@@ -46,7 +51,7 @@ For non-interactive use or scripting, you can use the following command-line fla
|
|
|
46
51
|
|
|
47
52
|
#### 1. Translate Specific Documents into Multiple Languages
|
|
48
53
|
|
|
49
|
-
To translate `overview.md` and `examples.md` into Chinese (`zh`) and Japanese (`ja`) without interactive prompts:
|
|
54
|
+
To translate `overview.md` and `examples.md` into Chinese (`zh`) and Japanese (`ja`) without any interactive prompts, run the following command:
|
|
50
55
|
|
|
51
56
|
```bash
|
|
52
57
|
aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
@@ -54,42 +59,42 @@ aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
|
54
59
|
|
|
55
60
|
#### 2. Use a Glossary for Consistent Terminology
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
If your documentation contains specialized vocabulary or brand names, you can use a glossary file to ensure they are always translated correctly.
|
|
58
63
|
|
|
59
64
|
```bash
|
|
60
|
-
aigne doc translate --glossary @./glossary.md
|
|
65
|
+
aigne doc translate --glossary @./project-glossary.md
|
|
61
66
|
```
|
|
62
67
|
|
|
63
68
|
#### 3. Provide Feedback to Refine Translation Style
|
|
64
69
|
|
|
65
|
-
You can guide the translation style by providing feedback. For instance, to request a more formal tone:
|
|
70
|
+
You can guide the translation style by providing feedback. For instance, to request a more formal and technical tone for the output:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
73
|
aigne doc translate --feedback "Use a formal, technical tone for all translations."
|
|
69
74
|
```
|
|
70
75
|
|
|
71
|
-
This feedback
|
|
76
|
+
This feedback is recorded in the document's update history, which can be useful for tracking changes.
|
|
72
77
|
|
|
73
78
|
## Supported Languages
|
|
74
79
|
|
|
75
80
|
The tool provides translation support for 12 languages. The native language of the documentation is English (`en`).
|
|
76
81
|
|
|
77
|
-
| Language
|
|
78
|
-
|
|
|
79
|
-
| Chinese (Simplified)
|
|
80
|
-
| Chinese (Traditional)| `zh-TW
|
|
81
|
-
| Japanese
|
|
82
|
-
| Korean
|
|
83
|
-
| Spanish
|
|
84
|
-
| French
|
|
85
|
-
| German
|
|
86
|
-
| Portuguese
|
|
87
|
-
| Russian
|
|
88
|
-
| Italian
|
|
89
|
-
| Arabic
|
|
82
|
+
| Language | Code |
|
|
83
|
+
| --------------------- | ------- |
|
|
84
|
+
| Chinese (Simplified) | `zh` |
|
|
85
|
+
| Chinese (Traditional) | `zh-TW` |
|
|
86
|
+
| Japanese | `ja` |
|
|
87
|
+
| Korean | `ko` |
|
|
88
|
+
| Spanish | `es` |
|
|
89
|
+
| French | `fr` |
|
|
90
|
+
| German | `de` |
|
|
91
|
+
| Portuguese | `pt` |
|
|
92
|
+
| Russian | `ru` |
|
|
93
|
+
| Italian | `it` |
|
|
94
|
+
| Arabic | `ar` |
|
|
90
95
|
|
|
91
96
|
## Summary
|
|
92
97
|
|
|
93
|
-
The `translate` command offers a structured method for localizing your documentation. You can use its interactive mode for guided
|
|
98
|
+
The `translate` command offers a structured and reliable method for localizing your documentation. You can use its interactive mode for a guided process or its command-line options for efficient, automated workflows. Features like glossaries and feedback help maintain the quality and consistency of the translated content.
|
|
94
99
|
|
|
95
|
-
After translating your documents,
|
|
100
|
+
After translating your documents, the next step is to make them available to your users. For instructions on how to do this, see the [Publishing Your Docs](./guides-publishing-your-docs.md) guide.
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
# 翻譯文件
|
|
2
2
|
|
|
3
|
-
本指南說明如何使用 `aigne doc translate` 指令將您產生的文件翻譯成多種語言。此過程使用 AI
|
|
3
|
+
本指南說明如何使用 `aigne doc translate` 指令將您產生的文件翻譯成多種語言。此過程使用 AI 來確保翻譯具有情境感知能力並保持技術準確性。
|
|
4
4
|
|
|
5
|
-
該工具支援 12
|
|
5
|
+
該工具支援 12 種語言,讓您能夠觸及全球受眾。您的來源文件的主要語言將自動從可用的翻譯語言清單中排除。
|
|
6
6
|
|
|
7
7
|
## `translate` 指令
|
|
8
8
|
|
|
9
|
-
`aigne doc translate`
|
|
9
|
+
`aigne doc translate` 指令用於為您現有的文件檔案產生翻譯。您可以以互動模式執行它來選擇您想要的文件和語言,或者您也可以使用命令列旗標直接指定這些選項以實現自動化工作流程。
|
|
10
10
|
|
|
11
11
|
### 互動模式
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
若要獲得引導式體驗,請在不帶任何參數的情況下執行此指令:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
aigne doc translate
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
執行時,該工具將執行以下步驟:
|
|
20
20
|
1. 掃描現有文件。
|
|
21
|
-
2.
|
|
21
|
+
2. 提示您從清單中選擇您希望翻譯的特定文件。
|
|
22
22
|
3. 提示您選擇目標翻譯語言。為方便起見,先前選擇的語言將被預先勾選。
|
|
23
|
-
4.
|
|
24
|
-
5.
|
|
23
|
+
4. 為每個選定的文件和語言組合開始翻譯過程。
|
|
24
|
+
5. 將翻譯後的文件儲存在同一個目錄中。新檔案的命名方式是在原始檔名後附加語言代碼(例如,`overview.md` 的中文翻譯會變成 `overview.zh.md`)。
|
|
25
25
|
|
|
26
26
|
### 命令列選項
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
對於非互動式使用或腳本編寫,您可以使用以下命令列旗標來控制翻譯過程。
|
|
29
29
|
|
|
30
30
|
<x-field-group>
|
|
31
31
|
<x-field data-name="--docs" data-type="array<string>">
|
|
32
|
-
<x-field-desc markdown
|
|
32
|
+
<x-field-desc markdown>指定一個或多個要翻譯的文件路徑。若未提供,該工具將進入互動模式,讓您從可用文件清單中進行選擇。</x-field-desc>
|
|
33
33
|
</x-field>
|
|
34
34
|
<x-field data-name="--langs" data-type="array<string>">
|
|
35
|
-
<x-field-desc markdown
|
|
35
|
+
<x-field-desc markdown>指定一個或多個目標語言代碼(例如 `zh`、`ja`)。若省略,系統將提示您以互動方式選擇語言。</x-field-desc>
|
|
36
36
|
</x-field>
|
|
37
37
|
<x-field data-name="--glossary" data-type="string">
|
|
38
|
-
<x-field-desc markdown
|
|
38
|
+
<x-field-desc markdown>提供詞彙表檔案的路徑(例如 `@path/to/glossary.md`)。這能確保特定的技術術語在所有文件中得到一致的翻譯。</x-field-desc>
|
|
39
39
|
</x-field>
|
|
40
40
|
<x-field data-name="--feedback" data-type="string">
|
|
41
|
-
<x-field-desc markdown
|
|
41
|
+
<x-field-desc markdown>提供具體的指示或回饋來引導 AI 的翻譯風格,例如調整語氣或術語。</x-field-desc>
|
|
42
42
|
</x-field>
|
|
43
43
|
</x-field-group>
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ aigne doc translate
|
|
|
46
46
|
|
|
47
47
|
#### 1. 將特定文件翻譯成多種語言
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
若要將 `overview.md` 和 `examples.md` 翻譯成中文(`zh`)和日文(`ja`)且不使用互動式提示:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
@@ -54,25 +54,25 @@ aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
|
54
54
|
|
|
55
55
|
#### 2. 使用詞彙表以確保術語一致
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
為確保技術術語翻譯正確,請提供一個詞彙表檔案。這對於保持品牌名稱或專業詞彙的一致性很有用。
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
aigne doc translate --glossary @./glossary.md
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
#### 3.
|
|
63
|
+
#### 3. 提供回饋以完善翻譯風格
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
您可以透過提供回饋來引導翻譯風格。例如,若要請求更正式的語氣:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
aigne doc translate --feedback "Use a formal, technical tone for all translations."
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
此回饋將記錄在更新後文件的歷史記錄中。
|
|
72
72
|
|
|
73
73
|
## 支援的語言
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
該工具支援 12 種語言的翻譯。文件的原生語言是英文(`en`)。
|
|
76
76
|
|
|
77
77
|
| 語言 | 代碼 |
|
|
78
78
|
| :--- | :--- |
|
|
@@ -90,6 +90,6 @@ aigne doc translate --feedback "Use a formal, technical tone for all translation
|
|
|
90
90
|
|
|
91
91
|
## 總結
|
|
92
92
|
|
|
93
|
-
`translate`
|
|
93
|
+
`translate` 指令提供了一種結構化的方法來本地化您的文件。您可以使用其互動模式進行引導式翻譯,或使用命令列選項進行自動化工作流程。使用詞彙表和回饋等功能有助於保持翻譯內容的品質和一致性。
|
|
94
94
|
|
|
95
|
-
翻譯完文件後,您可以繼續進行[
|
|
95
|
+
翻譯完文件後,您可以繼續進行[發佈您的文件](./guides-publishing-your-docs.md)。
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# 翻译文档
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本指南介绍如何使用 `aigne doc translate` 命令将您生成的文档翻译成多种语言。该过程利用 AI 来确保翻译能够感知上下文并保持技术准确性。
|
|
4
4
|
|
|
5
|
-
该工具支持 12
|
|
5
|
+
该工具支持 12 种语言,让您的内容能够触达全球受众。您源文档的主要语言将自动从可用翻译语言列表中排除。
|
|
6
6
|
|
|
7
7
|
## `translate` 命令
|
|
8
8
|
|
|
9
|
-
`aigne doc translate`
|
|
9
|
+
`aigne doc translate` 命令用于为现有文档文件生成翻译。您可以以交互方式运行它来选择要翻译的文档和语言,也可以直接使用命令行标志指定这些选项以实现自动化工作流程。
|
|
10
10
|
|
|
11
11
|
### 交互模式
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
如需引导式体验,请不带任何参数运行该命令:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
aigne doc translate
|
|
@@ -18,27 +18,27 @@ aigne doc translate
|
|
|
18
18
|
|
|
19
19
|
执行后,该工具将执行以下步骤:
|
|
20
20
|
1. 扫描现有文档。
|
|
21
|
-
2.
|
|
22
|
-
3.
|
|
21
|
+
2. 提示您从列表中选择要翻译的具体文档。
|
|
22
|
+
3. 提示您选择目标翻译语言。为方便起见,先前选择的语言将被预先勾选。
|
|
23
23
|
4. 为每个选定的文档和语言对开始翻译过程。
|
|
24
|
-
5.
|
|
24
|
+
5. 将翻译后的文件保存在同一目录中。新文件通过在原始文件名后附加语言代码来命名(例如,`overview.md` 的中文翻译将变为 `overview.zh.md`)。
|
|
25
25
|
|
|
26
26
|
### 命令行选项
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
对于非交互式使用或脚本编写,您可以使用以下命令行标志来控制翻译过程。
|
|
29
29
|
|
|
30
30
|
<x-field-group>
|
|
31
31
|
<x-field data-name="--docs" data-type="array<string>">
|
|
32
|
-
<x-field-desc markdown
|
|
32
|
+
<x-field-desc markdown>指定要翻译的一个或多个文档路径。如果未提供,该工具将进入交互模式,让您从可用文档列表中进行选择。</x-field-desc>
|
|
33
33
|
</x-field>
|
|
34
34
|
<x-field data-name="--langs" data-type="array<string>">
|
|
35
|
-
<x-field-desc markdown
|
|
35
|
+
<x-field-desc markdown>指定一个或多个目标语言代码(例如 `zh`、`ja`)。如果省略,系统将提示您以交互方式选择语言。</x-field-desc>
|
|
36
36
|
</x-field>
|
|
37
37
|
<x-field data-name="--glossary" data-type="string">
|
|
38
|
-
<x-field-desc markdown
|
|
38
|
+
<x-field-desc markdown>提供词汇表文件的路径(例如 `@path/to/glossary.md`)。这可以确保特定技术术语在所有文档中得到一致的翻译。</x-field-desc>
|
|
39
39
|
</x-field>
|
|
40
40
|
<x-field data-name="--feedback" data-type="string">
|
|
41
|
-
<x-field-desc markdown
|
|
41
|
+
<x-field-desc markdown>提供具体说明或反馈以指导 AI 的翻译风格,例如调整语气或术语。</x-field-desc>
|
|
42
42
|
</x-field>
|
|
43
43
|
</x-field-group>
|
|
44
44
|
|
|
@@ -46,15 +46,15 @@ aigne doc translate
|
|
|
46
46
|
|
|
47
47
|
#### 1. 将特定文档翻译成多种语言
|
|
48
48
|
|
|
49
|
-
要将 `overview.md` 和 `examples.md` 翻译成中文(`zh`)和日文(`ja
|
|
49
|
+
要将 `overview.md` 和 `examples.md` 翻译成中文(`zh`)和日文(`ja`),且无需交互式提示:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
aigne doc translate --docs overview.md --docs examples.md --langs zh --langs ja
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
#### 2.
|
|
55
|
+
#### 2. 使用词汇表确保术语一致
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
为确保技术术语翻译正确,请提供词汇表文件。这对于保持品牌名称或专业词汇的一致性非常有用。
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
aigne doc translate --glossary @./glossary.md
|
|
@@ -62,7 +62,7 @@ aigne doc translate --glossary @./glossary.md
|
|
|
62
62
|
|
|
63
63
|
#### 3. 提供反馈以优化翻译风格
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
您可以通过提供反馈来指导翻译风格。例如,要求使用更正式的语气:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
aigne doc translate --feedback "Use a formal, technical tone for all translations."
|
|
@@ -72,7 +72,7 @@ aigne doc translate --feedback "Use a formal, technical tone for all translation
|
|
|
72
72
|
|
|
73
73
|
## 支持的语言
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
该工具支持 12 种语言的翻译。文档的母语是英语(`en`)。
|
|
76
76
|
|
|
77
77
|
| 语言 | 代码 |
|
|
78
78
|
| :--- | :--- |
|
|
@@ -90,6 +90,6 @@ aigne doc translate --feedback "Use a formal, technical tone for all translation
|
|
|
90
90
|
|
|
91
91
|
## 总结
|
|
92
92
|
|
|
93
|
-
`translate`
|
|
93
|
+
`translate` 命令为本地化文档提供了一种结构化方法。您可以使用其交互模式进行引导式翻译,或使用命令行选项实现自动化工作流程。使用词汇表和反馈等功能有助于保持翻译内容的质量和一致性。
|
|
94
94
|
|
|
95
95
|
翻译完文档后,您可以继续[发布您的文档](./guides-publishing-your-docs.md)。
|