Skip to content

Commit

Permalink
docs: Add links, fix typo, enable clippy::doc_markdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored and pyfisch committed Feb 12, 2024
1 parent a6722e3 commit 7322f1b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc-valid-idents = ["WebDriver", ".."]
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//! but this crate should be useful for anyone implementing keyboard
//! input in a cross-platform way.
#![warn(clippy::doc_markdown)]

use std::fmt;

pub use crate::code::{Code, UnrecognizedCodeError};
Expand Down Expand Up @@ -54,7 +56,7 @@ pub struct KeyboardEvent {
/// True if the key is currently auto-repeated.
pub repeat: bool,
/// Events with this flag should be ignored in a text editor
/// and instead composition events should be used.
/// and instead [composition events](CompositionEvent) should be used.
pub is_composing: bool,
}

Expand Down Expand Up @@ -88,9 +90,9 @@ impl fmt::Display for CompositionState {
/// Provides information about entered sequences from
/// dead key combinations and IMEs.
///
/// A composition session is always started by a "compositionstart"
/// event followed my zero or more "compositionupdate" events
/// and terminated by a single "compositionend" event.
/// A composition session is always started by a [`CompositionState::Start`]
/// event followed my zero or more [`CompositionState::Update`] events
/// and terminated by a single [`CompositionState::End`] event.
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CompositionEvent {
Expand Down
2 changes: 1 addition & 1 deletion src/shortcuts.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{Key, KeyState, KeyboardEvent, Modifiers};

/// Match keyboard shortcuts and excute actions.
/// Match keyboard shortcuts and execute actions.
///
/// Every shortcut consists of a list of modifier keys pressed and a
/// single non-modifier key pressed.
Expand Down
16 changes: 8 additions & 8 deletions src/webdriver.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Keyboard related WebDriver functionality.
//!
//! The low-level `dispatch_keydown` and `dispatch_keyup` API
//! creates keyboard events from WebDriver codes. It is used
//! in the *Perform Actions* API.
//! The low-level [`KeyInputState::dispatch_keydown`] and
//! [`KeyInputState::dispatch_keyup`] API creates keyboard events
//! from WebDriver codes. It is used in the *Perform Actions* API.
//!
//! ```rust
//! # extern crate keyboard_types;
Expand All @@ -24,9 +24,9 @@
//! keyboard_event = state.dispatch_keyup('a').expect("key is released");
//! ```
//!
//! The higher level `send_keys` function is used for the *Element Send Keys*
//! WebDriver API. It accepts a string and returns a sequence of `KeyboardEvent`
//! and `CompositionEvent` values.
//! The higher level [`send_keys`] function is used for the *Element Send Keys*
//! WebDriver API. It accepts a string and returns a sequence of [`KeyboardEvent`]
//! and [`CompositionEvent`] values.
//!
//! ```rust
//! # extern crate keyboard_types;
Expand Down Expand Up @@ -398,9 +398,9 @@ impl KeyInputState {
}
}

/// Either a `KeyboardEvent` or a `CompositionEvent`.
/// Either a [`KeyboardEvent`] or a [`CompositionEvent`].
///
/// Returned by the `send_keys` function.
/// Returned by the [`send_keys`] function.
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Event {
Expand Down

0 comments on commit 7322f1b

Please sign in to comment.