Skip to content

Add documentation for prompt types and validators in English and Japanese#342

Merged
shibayan merged 1 commit intomasterfrom
add-ja
Mar 31, 2026
Merged

Add documentation for prompt types and validators in English and Japanese#342
shibayan merged 1 commit intomasterfrom
add-ja

Conversation

@shibayan
Copy link
Copy Markdown
Owner

  • 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.
@shibayan shibayan requested a review from Copilot March 31, 2026 16:28
@shibayan shibayan self-assigned this Mar 31, 2026
@shibayan shibayan added the documentation Improvements or additions to documentation label Mar 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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` を押すとデフォルト値が返されます。この動作を変更して例外をスローさせることができます:
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

キャンセル動作の説明が現状の実装と一致していません。Ctrl+C(および Escape)はキャンセルコールバックを呼び出し、Prompt.ThrowExceptionOnCancel が true の場合は PromptCanceledException をスローし、デフォルトでは Environment.Exit(1) でプロセス終了します(「デフォルト値が返る」わけではありません)。説明を実装に合わせて修正してください。

Suggested change
デフォルトでは、`Ctrl+C` を押すとデフォルト値が返されます。この動作を変更して例外をスローさせることができます:
デフォルトでは、`Ctrl+C` `Esc` を押すとキャンセルコールバックが呼び出され、その後 `Environment.Exit(1)` によってプロセスが終了します。`Prompt.ThrowExceptionOnCancel``true` に設定すると、代わりに `PromptCanceledException` がスローされます:

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +11
データアノテーション付きのモデルクラスを定義します:

```csharp
using System.ComponentModel.DataAnnotations;

Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prompt.Bind<T>() は Source Generator で生成されたバインダーが必要で、未生成の場合は [PromptBindable] を付けるよう促す InvalidOperationException が発生します。この例ではモデルクラスに [PromptBindable] を付与する必要があること(およびソースジェネレータが動作すること)を明記してください。

Suggested change
データアノテーション付きのモデルクラスを定義します:
```csharp
using System.ComponentModel.DataAnnotations;
データアノテーション付きのモデルクラスを定義します(`Prompt.Bind<T>()` を利用するには、モデルクラスに `[PromptBindable]` 属性を付与し、対応するバインダーが Source Generator によって生成されている必要があります):
```csharp
using System.ComponentModel.DataAnnotations;
using Sharprompt;
[PromptBindable]

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
| バリデータ | 説明 |
|-----------|-------------|
| `Validators.Required()` | 入力が空でないことを確認します |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この表は ||(パイプが2つ)で始まっているため、Markdown では先頭に空列がある表として解釈されます。ヘッダー/区切り行は先頭を | 1つにして正しくレンダリングされるようにしてください。

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
| パラメータ | 型 | 説明 |
|-----------|------|-------------|
| `message` | `string` | ユーザーに表示するメッセージ |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

パラメータ表の行頭が || になっており、Markdown では先頭に空列が入った表として表示されます。行頭は | 1つに修正してください。

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
| パラメータ | 型 | 説明 |
|-----------|------|-------------|
| `message` | `string` | ユーザーに表示するメッセージ |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

パラメータ表の行頭が || のため、Markdown で先頭に空列ができてしまいます。行頭を | 1つに修正してください。

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +23
| パラメータ | 型 | 説明 |
|-----------|------|-------------|
| `message` | `string` | ユーザーに表示するメッセージ |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

パラメータ表の行頭が || のため、Markdown で先頭に空列が表示されます。行頭を | 1つに修正してください。

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +46
| プロパティの型 / 属性 | プロンプトタイプ |
|--------------------------|-------------|
| `string` | Input |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「仕組み」の表が || で始まっているため、Markdown では先頭に空列がある表として表示されます。ヘッダー/区切り行の行頭を | 1つに修正してください。

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +50
| プラットフォーム | ターミナル |
|----------|----------|
| Windows | コマンドプロンプト、PowerShell、Windows Terminal |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

サポートされているプラットフォームの表が || で始まっているため、Markdown で先頭に空列が入ります。行頭を | 1つに修正してください。

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +23
| シンボル | デフォルト (Unicode) | デフォルト (フォールバック) | 説明 |
|--------|-------------------|-------------------|-------------|
| `Prompt` | `?` | `?` | プロンプトメッセージの前に表示 |
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「利用可能なシンボル」の表が || で始まっており、Markdown では先頭に空列が表示されます。ヘッダー/区切り行の行頭を | 1つに修正してください。

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +66
{
text: 'Introduction',
items: [
{ text: 'Getting Started', link: '/ja/getting-started' }
]
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@shibayan shibayan merged commit 3602f54 into master Mar 31, 2026
9 checks passed
@shibayan shibayan deleted the add-ja branch March 31, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants