From 3137ee35f97cec84ccde1adbd1a5d8397cceef7a Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Thu, 7 Nov 2024 23:16:25 -0800 Subject: [PATCH] cleanup doc links --- ratatui-widgets/Cargo.toml | 4 ++++ ratatui-widgets/src/barchart.rs | 18 +++++++-------- ratatui-widgets/src/barchart/bar.rs | 12 +++++----- ratatui-widgets/src/block.rs | 24 ++++++++++---------- ratatui-widgets/src/block/padding.rs | 4 ++-- ratatui-widgets/src/block/title.rs | 22 +++++++++--------- ratatui-widgets/src/borders.rs | 6 ++--- ratatui-widgets/src/calendar.rs | 12 +++++----- ratatui-widgets/src/canvas.rs | 14 +++++------- ratatui-widgets/src/canvas/map.rs | 2 +- ratatui-widgets/src/canvas/rectangle.rs | 2 +- ratatui-widgets/src/chart.rs | 8 +++---- ratatui-widgets/src/clear.rs | 2 +- ratatui-widgets/src/lib.rs | 2 +- ratatui-widgets/src/list.rs | 30 +++++++++++-------------- ratatui-widgets/src/list/item.rs | 20 ++++++++--------- ratatui-widgets/src/list/state.rs | 4 ++-- ratatui-widgets/src/paragraph.rs | 4 ++-- ratatui-widgets/src/scrollbar.rs | 10 ++++----- ratatui-widgets/src/sparkline.rs | 10 ++++----- ratatui-widgets/src/table.rs | 25 +++++++++------------ ratatui-widgets/src/table/cell.rs | 12 +++++----- ratatui-widgets/src/table/row.rs | 12 +++++----- ratatui-widgets/src/table/state.rs | 7 +++--- ratatui-widgets/src/tabs.rs | 4 ++-- 25 files changed, 132 insertions(+), 138 deletions(-) diff --git a/ratatui-widgets/Cargo.toml b/ratatui-widgets/Cargo.toml index 194a0a98..89728b93 100644 --- a/ratatui-widgets/Cargo.toml +++ b/ratatui-widgets/Cargo.toml @@ -40,6 +40,10 @@ unstable-widget-ref = ["ratatui-core/unstable-widget-ref"] ## See [Issue 293](https://github.com/ratatui/ratatui/issues/293) for more details. unstable-rendered-line-info = [] +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] bitflags.workspace = true itertools.workspace = true diff --git a/ratatui-widgets/src/barchart.rs b/ratatui-widgets/src/barchart.rs index 55821324..65b845ec 100644 --- a/ratatui-widgets/src/barchart.rs +++ b/ratatui-widgets/src/barchart.rs @@ -191,7 +191,7 @@ impl<'a> BarChart<'a> { /// It is also possible to set individually the style of each [`Bar`]. /// In this case the default style will be patched by the individual style /// - /// [`Color`]: crate::style::Color + /// [`Color`]: ratatui_core::style::Color #[must_use = "method moves the value of self and returns the modified value"] pub fn bar_style>(mut self, style: S) -> Self { self.bar_style = style.into(); @@ -200,8 +200,8 @@ impl<'a> BarChart<'a> { /// Set the width of the displayed bars. /// - /// For [`Horizontal`](crate::layout::Direction::Horizontal) bars this becomes the height of - /// the bar. + /// For [`Horizontal`](ratatui_core::layout::Direction::Horizontal) bars this becomes the height + /// of the bar. /// /// If not set, this defaults to `1`. /// The bar label also uses this value as its width. @@ -236,9 +236,9 @@ impl<'a> BarChart<'a> { self } - /// The [`bar::Set`](crate::symbols::bar::Set) to use for displaying the bars. + /// The [`bar::Set`](ratatui_core::symbols::bar::Set) to use for displaying the bars. /// - /// If not set, the default is [`bar::NINE_LEVELS`](crate::symbols::bar::NINE_LEVELS). + /// If not set, the default is [`bar::NINE_LEVELS`](ratatui_core::symbols::bar::NINE_LEVELS). #[must_use = "method moves the value of self and returns the modified value"] pub const fn bar_set(mut self, bar_set: symbols::bar::Set) -> Self { self.bar_set = bar_set; @@ -257,7 +257,7 @@ impl<'a> BarChart<'a> { /// /// [`Bar::value_style`] to set the value style individually. /// - /// [`Color`]: crate::style::Color + /// [`Color`]: ratatui_core::style::Color #[must_use = "method moves the value of self and returns the modified value"] pub fn value_style>(mut self, style: S) -> Self { self.value_style = style.into(); @@ -276,7 +276,7 @@ impl<'a> BarChart<'a> { /// /// [`Bar::label`] to set the label style individually. /// - /// [`Color`]: crate::style::Color + /// [`Color`]: ratatui_core::style::Color #[must_use = "method moves the value of self and returns the modified value"] pub fn label_style>(mut self, style: S) -> Self { self.label_style = style.into(); @@ -297,7 +297,7 @@ impl<'a> BarChart<'a> { /// /// The style will be applied to everything that isn't styled (borders, bars, labels, ...). /// - /// [`Color`]: crate::style::Color + /// [`Color`]: ratatui_core::style::Color #[must_use = "method moves the value of self and returns the modified value"] pub fn style>(mut self, style: S) -> Self { self.style = style.into(); @@ -306,7 +306,7 @@ impl<'a> BarChart<'a> { /// Set the direction of the bars. /// - /// [`Vertical`](crate::layout::Direction::Vertical) bars are the default. + /// [`Vertical`](ratatui_core::layout::Direction::Vertical) bars are the default. /// /// # Examples /// diff --git a/ratatui-widgets/src/barchart/bar.rs b/ratatui-widgets/src/barchart/bar.rs index 8c0121d4..6e403b73 100644 --- a/ratatui-widgets/src/barchart/bar.rs +++ b/ratatui-widgets/src/barchart/bar.rs @@ -1,7 +1,7 @@ use ratatui_core::{buffer::Buffer, layout::Rect, style::Style, text::Line, widgets::Widget}; use unicode_width::UnicodeWidthStr; -/// A bar to be shown by the [`BarChart`](crate::widgets::BarChart) widget. +/// A bar to be shown by the [`BarChart`](crate::barchart::BarChart) widget. /// /// Here is an explanation of a `Bar`'s components. /// ```plain @@ -59,11 +59,11 @@ impl<'a> Bar<'a> { /// Set the label of the bar. /// - /// For [`Vertical`](crate::layout::Direction::Vertical) bars, + /// For [`Vertical`](ratatui_core::layout::Direction::Vertical) bars, /// display the label **under** the bar. - /// For [`Horizontal`](crate::layout::Direction::Horizontal) bars, + /// For [`Horizontal`](ratatui_core::layout::Direction::Horizontal) bars, /// display the label **in** the bar. - /// See [`BarChart::direction`](crate::widgets::BarChart::direction) to set the direction. + /// See [`BarChart::direction`](crate::barchart::BarChart::direction) to set the direction. #[must_use = "method moves the value of self and returns the modified value"] pub fn label(mut self, label: Line<'a>) -> Self { self.label = Some(label); @@ -77,7 +77,7 @@ impl<'a> Bar<'a> { /// /// This will apply to every non-styled element. It can be seen and used as a default value. /// - /// [`Color`]: crate::style::Color + /// [`Color`]: ratatui_core::style::Color #[must_use = "method moves the value of self and returns the modified value"] pub fn style>(mut self, style: S) -> Self { self.style = style.into(); @@ -93,7 +93,7 @@ impl<'a> Bar<'a> { /// /// [`Bar::value`] to set the value. /// - /// [`Color`]: crate::style::Color + /// [`Color`]: ratatui_core::style::Color #[must_use = "method moves the value of self and returns the modified value"] pub fn value_style>(mut self, style: S) -> Self { self.value_style = style.into(); diff --git a/ratatui-widgets/src/block.rs b/ratatui-widgets/src/block.rs index 33c57c0f..1dedca0d 100644 --- a/ratatui-widgets/src/block.rs +++ b/ratatui-widgets/src/block.rs @@ -24,7 +24,7 @@ use crate::borders::{BorderType, Borders}; mod padding; pub mod title; -/// Base widget to be used to display a box border around all [upper level ones](crate::widgets). +/// Base widget to be used to display a box border around all other built-in widgets. /// /// The borders can be configured with [`Block::borders`] and others. A block can have multiple /// [`Title`] using [`Block::title`]. It can also be [styled](Block::style) and @@ -172,8 +172,8 @@ impl<'a> Block<'a> { /// space is calculated based on the full width of the block, rather than the leftover width. /// /// You can provide any type that can be converted into [`Title`] including: strings, string - /// slices (`&str`), borrowed strings (`Cow`), [spans](crate::text::Span), or vectors of - /// [spans](crate::text::Span) (`Vec`). + /// slices (`&str`), borrowed strings (`Cow`), [spans](ratatui_core::text::Span), or + /// vectors of [spans](ratatui_core::text::Span) (`Vec`). /// /// By default, the titles will avoid being rendered in the corners of the block but will align /// against the left or right edge of the block if there is no border on that edge. The @@ -247,8 +247,8 @@ impl<'a> Block<'a> { /// Adds a title to the top of the block. /// /// You can provide any type that can be converted into [`Line`] including: strings, string - /// slices (`&str`), borrowed strings (`Cow`), [spans](crate::text::Span), or vectors of - /// [spans](crate::text::Span) (`Vec`). + /// slices (`&str`), borrowed strings (`Cow`), [spans](ratatui_core::text::Span), or + /// vectors of [spans](ratatui_core::text::Span) (`Vec`). /// /// # Example /// @@ -276,8 +276,8 @@ impl<'a> Block<'a> { /// Adds a title to the bottom of the block. /// /// You can provide any type that can be converted into [`Line`] including: strings, string - /// slices (`&str`), borrowed strings (`Cow`), [spans](crate::text::Span), or vectors of - /// [spans](crate::text::Span) (`Vec`). + /// slices (`&str`), borrowed strings (`Cow`), [spans](ratatui_core::text::Span), or + /// vectors of [spans](ratatui_core::text::Span) (`Vec`). /// /// # Example /// @@ -313,7 +313,7 @@ impl<'a> Block<'a> { /// `style` accepts any type that is convertible to [`Style`] (e.g. [`Style`], [`Color`], or /// your own type that implements [`Into