From 8f555b9e52e7bd20b2291746ef6902ee63a47687 Mon Sep 17 00:00:00 2001 From: wadackel Date: Mon, 8 Jan 2024 18:51:19 +0900 Subject: [PATCH 1/2] docs: update --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c895c1d..29105c0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ GitHub Actions Workflow Status Crates.io Version docs.rs - MIT License + MIT LICENSE

Promptuity is a library that provides interactive prompts. It is highly extensible, allowing you to build your original prompts from scratch. It brings ingenuity to various projects.

@@ -81,7 +81,7 @@ Please refer to the [documentation](https://docs.rs/promptuity). ## Prompts -[promptuity::prompts](#) offers five built-in prompts. +[`promptuity::prompts`](https://docs.rs/promptuity/latest/promptuity/prompts/index.html) offers five built-in prompts. To implement your original prompt, please see the [Build your own Prompt](#build-your-own-prompt) section. ### Input @@ -181,7 +181,7 @@ This section provides guidance on how to construct original prompts and Themes. ### Build your own Prompt -Creating an original prompt can be achieved by implementing the [`Prompt`](#) trait. By implementing three lifecycle methods, you can build prompts that are usable with [`Promptuity::prompt`](#). +Creating an original prompt can be achieved by implementing the [`Prompt`](https://docs.rs/promptuity/latest/promptuity/trait.Prompt.html) trait. By implementing three lifecycle methods, you can build prompts that are usable with [`Promptuity::prompt`](https://docs.rs/promptuity/latest/promptuity/struct.Promptuity.html#method.prompt). Promptuity prompts consist of the following elements: @@ -223,7 +223,7 @@ First, let's implement the reception of key inputs. #### 1. Receiving Key Input -Handle key inputs in the [`Prompt::handle`](#) method. +Handle key inputs in the [`Prompt::handle`](https://docs.rs/promptuity/latest/promptuity/trait.Prompt.html#tymethod.handle) method. For example, let's implement it so that pressing y for Yes and n for No finalizes the result. @@ -262,7 +262,7 @@ You can freely combine key codes and modifiers, allowing the construction of com #### 2. Rendering the Prompt -Construct the rendering content in the [`Prompt::render`](#) method. Here's a simple example using only **Input** without a **Body**. +Construct the rendering content in the [`Prompt::render`](https://docs.rs/promptuity/latest/promptuity/trait.Prompt.html#tymethod.render) method. Here's a simple example using only **Input** without a **Body**. ```rust use promptuity::event::{KeyCode, KeyModifiers}; @@ -290,7 +290,7 @@ impl Prompt for CustomConfirm { } ``` -Determine the appropriate rendering content based on the `PromptState` returned by `Prompt::handle`. The above implementation achieves the following requirements: +Determine the appropriate rendering content based on the [`PromptState`](https://docs.rs/promptuity/latest/promptuity/enum.PromptState.html) returned by [`Prompt::handle`](https://docs.rs/promptuity/latest/promptuity/trait.Prompt.html#tymethod.handle). The above implementation achieves the following requirements: - The result displays either `Yes` or `No`. - If the prompt is interrupted, only the message is displayed. @@ -300,7 +300,7 @@ Determine the appropriate rendering content based on the `PromptState` returned This is the final step in constructing a custom prompt. -Implement the `Prompt::submit` method, which returns the final value for the received key input. +Implement the [`Prompt::submit`](https://docs.rs/promptuity/latest/promptuity/trait.Prompt.html#tymethod.submit) method, which returns the final value for the received key input. ```rust impl Prompt for CustomConfirm { @@ -328,7 +328,7 @@ For a complete example, please refer to [examples/custom_theme.rs](./examples/cu ## Error Handling -All errors are consolidated into [`promptuity::Error`](#). +All errors are consolidated into [`promptuity::Error`](https://docs.rs/promptuity/latest/promptuity/enum.Error.html). In many cases, prompt interruptions will need to be handled individually. Interruptions occur during user input reception, typically through inputs like Ctrl + C or ESC. From 968ad7d1e9bf2ad2ac1269f94404c9f2f7f01e3e Mon Sep 17 00:00:00 2001 From: wadackel Date: Mon, 8 Jan 2024 18:53:25 +0900 Subject: [PATCH 2/2] chore: tweak ci --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb80cb9..a891111 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,12 @@ name: CI on: push: + branches: + - main pull_request: - types: [opened, synchronize] + types: + - opened + - synchronize env: CARGO_TERM_COLOR: always