diff --git a/src/error.rs b/src/error.rs index a37720a..a035058 100644 --- a/src/error.rs +++ b/src/error.rs @@ -31,7 +31,7 @@ pub struct RegexError( #[from] regex::Error, ); -/// Errors that can occur during setup +/// Errors that can occur during setup. #[derive(Debug, thiserror::Error)] #[allow(clippy::module_name_repetitions)] pub enum SetupError { @@ -54,7 +54,7 @@ pub enum SetupError { TerminalSize(TermError), } -/// Errors that can occur during clean up +/// Errors that can occur during clean up. #[derive(Debug, thiserror::Error)] #[allow(clippy::module_name_repetitions)] pub enum CleanupError { @@ -71,7 +71,7 @@ pub enum CleanupError { LeaveAlternateScreen(TermError), } -/// Errors that can happen while running +/// Errors that can happen during runtime. #[derive(Debug, thiserror::Error)] #[allow(clippy::module_name_repetitions)] pub enum MinusError { diff --git a/src/input/mod.rs b/src/input/mod.rs index 780e959..6fcdd11 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1,18 +1,12 @@ -//! Working with user keyboard/mouse events +//! Manage keyboard/mouse-bindings while running `minus`. //! -//! minus already has a sensible set of default key/mouse bindings so most people do not need to -//! care about this module. But if you want to add or remove certain key bindings then you need -//! to rely on this module.. -//! -//! This module provides various items for defining registering keyboard/mouse event from the -//! user's terminal to a predefined action inside minus. -//! -//! For this document we will call any keyboard/mouse event from the terminal as a **binding** +//! > **Terminology in this module**: We will call any keyboard/mouse event from the terminal as a **binding** //! and its associated predefined action as **callback**. //! -//! There are two ways to define binding in minus +//! There are two ways to define binding in minus as you will see below. //! //! # Newer (Recommended) Method +//! ## Description //! This method offers a much improved and ergonomic API for defining bindings and callbacks. //! You use the [HashedEventRegister] for registering bindings and their associated callback. //! It provides functions like [add_key_events](HashedEventRegister::add_key_events) and @@ -99,7 +93,7 @@ //! manually copy the [default definitions](DefaultInputClassifier) and make the required //! modifications yourself in this method. This lead to very messy and error-prone system for //! defining bindings and also required application authors to bring in the the underlying -//! [crossterm](https://docs.rs/crossterm/latest) crate to define the innputs. +//! [crossterm](https://docs.rs/crossterm/latest) crate to define the events. //! //! ## Example //! ``` @@ -154,15 +148,14 @@ //! more data from a server but not necessarily sending it to minus. In these types of scenarios, //! the [InputEvent::Ignore] is most likely your true friend. When this is returned by a callback //! function, minus will execute your code but not do anything special for the event on its part. -//! ```text +//! ```no_test //! input_register.add_key_events(&["f"], |_, ps| { //! fetch_data_from_server(...); //! InputEvent::Ignore //! }); -//! //! ``` //! It can be used with the legacy method too. -//! ```text +//! ```no_test //! struct CustomInputClassifier; //! impl InputClassifier for CustomInputClassifier { //! fn classify_input( diff --git a/src/lib.rs b/src/lib.rs index 4055d51..7a868a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,7 +18,7 @@ //! If you want to learn about its motivation and features, please take a look into it's [README]. //! //! # Overview -//! When getting started with minus, the two most important concepts to get familier with are:- +//! When getting started with minus, the two most important concepts to get familier with are: //! * The [Pager] type: which acts as a bridge between your application and minus. It is used //! to pass data and configure minus before and after starting the pager. //! * Initialization functions: This includes the [dynamic_paging] and [page_all] functions which @@ -112,7 +112,7 @@ //! In static mode, `minus` doesn't start the pager and just prints the content if the current terminal size can //! display all lines. You can of course change this behaviour. //! -//! ## Standard actions +//! ## Default keybindings //! //! Here is the list of default key/mouse actions handled by `minus`. //!