Conversation
shibayan
commented
Mar 31, 2026
- Created documentation for the following prompt types:
- Bind (Model-based Prompts)
- Confirm
- Input
- List
- MultiSelect
- Password
- Select
- Added a section for built-in validators and custom validators.
- Translated all documentation into Japanese, including prompt types and validators.
- Updated advanced features and configuration documentation in Japanese.
- Included examples and usage instructions for each prompt type and validator.
…nese - Created documentation for the following prompt types: - Bind (Model-based Prompts) - Confirm - Input - List - MultiSelect - Password - Select - Added a section for built-in validators and custom validators. - Translated all documentation into Japanese, including prompt types and validators. - Updated advanced features and configuration documentation in Japanese. - Included examples and usage instructions for each prompt type and validator.
There was a problem hiding this comment.
Pull request overview
This PR adds a full VitePress documentation set for Sharprompt in both English and Japanese, covering prompt types, validators, configuration, and advanced usage, and updates the site config to support the two locales.
Changes:
- Added English and Japanese pages for prompt types (Bind/Confirm/Input/List/MultiSelect/Password/Select) and validators, with examples.
- Added English and Japanese reference pages for configuration and advanced features.
- Updated VitePress config to introduce locale-aware navigation/sidebar and URL rewrites for English-as-root.
Reviewed changes
Copilot reviewed 13 out of 25 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/ja/validators.md | Adds Japanese validators reference and examples. |
| docs/ja/prompt-types/select.md | Adds Japanese Select prompt documentation. |
| docs/ja/prompt-types/password.md | Adds Japanese Password prompt documentation. |
| docs/ja/prompt-types/multi-select.md | Adds Japanese MultiSelect prompt documentation. |
| docs/ja/prompt-types/list.md | Adds Japanese List prompt documentation. |
| docs/ja/prompt-types/input.md | Adds Japanese Input prompt documentation. |
| docs/ja/prompt-types/confirm.md | Adds Japanese Confirm prompt documentation. |
| docs/ja/prompt-types/bind.md | Adds Japanese Bind (model-based) prompt documentation. |
| docs/ja/index.md | Adds Japanese docs home page frontmatter. |
| docs/ja/getting-started.md | Adds Japanese getting started guide. |
| docs/ja/configuration.md | Adds Japanese configuration reference. |
| docs/ja/advanced.md | Adds Japanese advanced features reference. |
| docs/en/validators.md | Adds English validators reference and examples. |
| docs/en/prompt-types/select.md | Adds English Select prompt documentation. |
| docs/en/prompt-types/password.md | Adds English Password prompt documentation. |
| docs/en/prompt-types/multi-select.md | Adds English MultiSelect prompt documentation. |
| docs/en/prompt-types/list.md | Adds English List prompt documentation. |
| docs/en/prompt-types/input.md | Adds English Input prompt documentation. |
| docs/en/prompt-types/confirm.md | Adds English Confirm prompt documentation. |
| docs/en/prompt-types/bind.md | Adds English Bind (model-based) prompt documentation. |
| docs/en/index.md | Adds English docs home page frontmatter. |
| docs/en/getting-started.md | Adds English getting started guide. |
| docs/en/configuration.md | Adds English configuration reference. |
| docs/en/advanced.md | Adds English advanced features reference. |
| docs/.vitepress/config.mts | Adds locale configuration (English root via rewrites + Japanese locale nav/sidebar). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## キャンセルのサポート | ||
|
|
||
| デフォルトでは、`Ctrl+C` を押すとデフォルト値が返されます。この動作を変更して例外をスローさせることができます: |
There was a problem hiding this comment.
キャンセル動作の説明が現状の実装と一致していません。Ctrl+C(および Escape)はキャンセルコールバックを呼び出し、Prompt.ThrowExceptionOnCancel が true の場合は PromptCanceledException をスローし、デフォルトでは Environment.Exit(1) でプロセス終了します(「デフォルト値が返る」わけではありません)。説明を実装に合わせて修正してください。
| デフォルトでは、`Ctrl+C` を押すとデフォルト値が返されます。この動作を変更して例外をスローさせることができます: | |
| デフォルトでは、`Ctrl+C` や `Esc` を押すとキャンセルコールバックが呼び出され、その後 `Environment.Exit(1)` によってプロセスが終了します。`Prompt.ThrowExceptionOnCancel` を `true` に設定すると、代わりに `PromptCanceledException` がスローされます: |
| データアノテーション付きのモデルクラスを定義します: | ||
|
|
||
| ```csharp | ||
| using System.ComponentModel.DataAnnotations; | ||
|
|
There was a problem hiding this comment.
Prompt.Bind<T>() は Source Generator で生成されたバインダーが必要で、未生成の場合は [PromptBindable] を付けるよう促す InvalidOperationException が発生します。この例ではモデルクラスに [PromptBindable] を付与する必要があること(およびソースジェネレータが動作すること)を明記してください。
| データアノテーション付きのモデルクラスを定義します: | |
| ```csharp | |
| using System.ComponentModel.DataAnnotations; | |
| データアノテーション付きのモデルクラスを定義します(`Prompt.Bind<T>()` を利用するには、モデルクラスに `[PromptBindable]` 属性を付与し、対応するバインダーが Source Generator によって生成されている必要があります): | |
| ```csharp | |
| using System.ComponentModel.DataAnnotations; | |
| using Sharprompt; | |
| [PromptBindable] |
| | バリデータ | 説明 | | ||
| |-----------|-------------| | ||
| | `Validators.Required()` | 入力が空でないことを確認します | |
There was a problem hiding this comment.
この表は ||(パイプが2つ)で始まっているため、Markdown では先頭に空列がある表として解釈されます。ヘッダー/区切り行は先頭を | 1つにして正しくレンダリングされるようにしてください。
| | パラメータ | 型 | 説明 | | ||
| |-----------|------|-------------| | ||
| | `message` | `string` | ユーザーに表示するメッセージ | |
There was a problem hiding this comment.
パラメータ表の行頭が || になっており、Markdown では先頭に空列が入った表として表示されます。行頭は | 1つに修正してください。
| | パラメータ | 型 | 説明 | | ||
| |-----------|------|-------------| | ||
| | `message` | `string` | ユーザーに表示するメッセージ | |
There was a problem hiding this comment.
パラメータ表の行頭が || のため、Markdown で先頭に空列ができてしまいます。行頭を | 1つに修正してください。
| | パラメータ | 型 | 説明 | | ||
| |-----------|------|-------------| | ||
| | `message` | `string` | ユーザーに表示するメッセージ | |
There was a problem hiding this comment.
パラメータ表の行頭が || のため、Markdown で先頭に空列が表示されます。行頭を | 1つに修正してください。
| | プロパティの型 / 属性 | プロンプトタイプ | | ||
| |--------------------------|-------------| | ||
| | `string` | Input | |
There was a problem hiding this comment.
「仕組み」の表が || で始まっているため、Markdown では先頭に空列がある表として表示されます。ヘッダー/区切り行の行頭を | 1つに修正してください。
| | プラットフォーム | ターミナル | | ||
| |----------|----------| | ||
| | Windows | コマンドプロンプト、PowerShell、Windows Terminal | |
There was a problem hiding this comment.
サポートされているプラットフォームの表が || で始まっているため、Markdown で先頭に空列が入ります。行頭を | 1つに修正してください。
| | シンボル | デフォルト (Unicode) | デフォルト (フォールバック) | 説明 | | ||
| |--------|-------------------|-------------------|-------------| | ||
| | `Prompt` | `?` | `?` | プロンプトメッセージの前に表示 | |
There was a problem hiding this comment.
「利用可能なシンボル」の表が || で始まっており、Markdown では先頭に空列が表示されます。ヘッダー/区切り行の行頭を | 1つに修正してください。
| { | ||
| text: 'Introduction', | ||
| items: [ | ||
| { text: 'Getting Started', link: '/ja/getting-started' } | ||
| ] |
There was a problem hiding this comment.
In the Japanese locale sidebar config, the section titles are still English (e.g., “Introduction”, “Prompt Types”, “Reference”). If the goal is a fully Japanese experience, these text labels should be translated as well for consistency with the Japanese nav.