Skip to content

Commit

Permalink
docs: align and fix doc comments (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
roele authored Feb 26, 2025
1 parent 3483342 commit 103e4e3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
13 changes: 7 additions & 6 deletions src/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use termcolor::{Buffer, WriteColor};
use crate::theme::Theme;
use crate::{ctrlc, theme};

/// Select multiple options from a list
/// A confirmation dialog
///
/// # Example
/// ```rust
Expand All @@ -29,23 +29,24 @@ use crate::{ctrlc, theme};
/// };
/// ```
pub struct Confirm<'a> {
/// The title of the selector
/// The title of the dialog
pub title: String,
/// The colors/style of the selector
/// The colors/style of the dialog
pub theme: &'a Theme,
/// A description to display above the selector
/// A description to display after the title
pub description: String,
/// The text to display for the affirmative option
pub affirmative: String,
/// The text to display for the negative option
pub negative: String,
/// If true, the affirmative option is selected by default
pub selected: bool,

term: Term,
}

impl<'a> Confirm<'a> {
/// Create a new multi select with the given title
/// Create a new confirmation dialog with the given title
pub fn new<S: Into<String>>(title: S) -> Self {
Self {
title: title.into(),
Expand All @@ -58,7 +59,7 @@ impl<'a> Confirm<'a> {
}
}

/// Set the description of the selector
/// Set the description of the dialog
pub fn description(mut self, description: &str) -> Self {
self.description = description.to_string();
self
Expand Down
8 changes: 4 additions & 4 deletions src/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl DialogButton {
}
}

/// A dialog to display to the user
/// A multi-button dialog
///
/// # Example
/// ```rust
Expand All @@ -58,11 +58,11 @@ impl DialogButton {
/// };
/// ```
pub struct Dialog<'a> {
/// The title of the selector
/// The title of the dialog
pub title: String,
/// The colors/style of the selector
/// The colors/style of the dialog
pub theme: &'a Theme,
/// A description to display above the selector
/// A description to display after the title
pub description: String,
/// The buttons to display to the user
pub buttons: Vec<DialogButton>,
Expand Down
4 changes: 2 additions & 2 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ use crate::{ctrlc, theme, Theme};
pub struct List<'a> {
/// Title of the list
pub title: String,
/// Description of the list
/// A description to display after the title
pub description: String,
/// Number of items to show on each page
pub success_items: usize,
/// Colors/style of the input
/// Colors/style of the list
pub theme: &'a Theme,

term: Term,
Expand Down
2 changes: 1 addition & 1 deletion src/multiselect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct MultiSelect<'a, T> {
pub title: String,
/// The colors/style of the selector
pub theme: &'a Theme,
/// A description to display above the selector
/// A description to display after the title
pub description: String,
/// The options which can be selected
pub options: Vec<DemandOption<T>>,
Expand Down
2 changes: 1 addition & 1 deletion src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Select<'a, T> {
pub title: String,
/// The colors/style of the selector
pub theme: &'a Theme,
/// A description to display above the selector
/// A description to display after the title
pub description: String,
/// The options which can be selected
pub options: Vec<DemandOption<T>>,
Expand Down
8 changes: 4 additions & 4 deletions src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ pub struct Theme {

/// Char to use for the cursor
pub cursor_shape: CursorShape,
/// the color when there isnt text to get color from
/// the color when there isn't text to get color from
pub cursor_style: ColorSpec,
/// use cusor_style even when there is text to get color from
/// use cursor_style even when there is text to get color from
pub force_style: bool,

/// Input cursor color
Expand All @@ -67,9 +67,9 @@ pub struct Theme {
/// Help item separator color
pub help_sep: ColorSpec,

/// Focused button
/// Focused button color
pub focused_button: ColorSpec,
/// Blurred button
/// Blurred button color
pub blurred_button: ColorSpec,

/// Error indicator color
Expand Down

0 comments on commit 103e4e3

Please sign in to comment.