From 0a14106127678bde6e95a450701263c909fffb21 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Tue, 26 May 2020 11:01:28 -0700 Subject: [PATCH] Fix doc links accross re-use --- cursive-core/src/backend.rs | 13 +++++++++---- cursive-core/src/direction.rs | 3 +++ cursive-core/src/event.rs | 5 +++-- cursive-core/src/lib.rs | 4 +++- cursive-core/src/logger.rs | 4 +++- cursive-core/src/menu.rs | 3 ++- cursive-core/src/theme/mod.rs | 12 ++++++++++++ cursive-core/src/utils/markup/mod.rs | 2 ++ cursive-core/src/view/nameable.rs | 2 ++ cursive-core/src/view/resizable.rs | 2 ++ cursive-core/src/views/text_view.rs | 4 ++++ cursive/src/backends/mod.rs | 4 +++- 12 files changed, 48 insertions(+), 10 deletions(-) diff --git a/cursive-core/src/backend.rs b/cursive-core/src/backend.rs index 8edfe3a..489d956 100644 --- a/cursive-core/src/backend.rs +++ b/cursive-core/src/backend.rs @@ -3,9 +3,11 @@ //! Cursive doesn't print anything by itself: it delegates this job to a //! backend library, which handles all actual input and output. //! -//! This module defines the `Backend` trait, as well as a few implementations +//! This module defines the [`Backend`] trait, as well as a few implementations //! using some common libraries. Each of those included backends needs a //! corresonding feature to be enabled. +//! +//! [`Backend`]: trait.Backend.html use crate::event::Event; use crate::theme; @@ -21,11 +23,14 @@ use unicode_width::UnicodeWidthStr; /// or termion, or it can entirely simulate a terminal and show it as a /// graphical window (`BearLibTerminal`). /// -/// When creating a new cursive tree with `Cursive::new()`, you will need to +/// When creating a new cursive tree with [`Cursive::new()`][1], you will need to /// provide a backend initializer - usually their `init()` function. /// -/// Backends are responsible for handling input and converting it to `Event`. Input must be -/// non-blocking, it will be polled regularly. +/// Backends are responsible for handling input and converting it to [`Event`]. +/// Input must be non-blocking, it will be polled regularly. +/// +/// [1]: ../struct.Cursive.html#method.new +/// [`Event`]: ../event/enum.Event.html pub trait Backend { /// Polls the backend for any input. /// diff --git a/cursive-core/src/direction.rs b/cursive-core/src/direction.rs index cb5d7e0..9e7230b 100644 --- a/cursive-core/src/direction.rs +++ b/cursive-core/src/direction.rs @@ -2,6 +2,9 @@ //! //! This module defines two main concepts: [`Orientation`] and [`Direction`]. //! +//! [`Orientation`]: enum.Orientation.html +//! [`Direction`]: enum.Direction.html +//! //! ### Orientation //! //! `Orientation` is a simple enum that can take two values: diff --git a/cursive-core/src/event.rs b/cursive-core/src/event.rs index 51f22ca..c036b76 100644 --- a/cursive-core/src/event.rs +++ b/cursive-core/src/event.rs @@ -9,8 +9,9 @@ //! choose to consume it or not. //! * If no view consumes the event, the [global callback] table is checked. //! -//! [`on_event`]: crate::View::on_event -//! [global callback]: crate::Cursive::add_global_callback +//! [`Event`]: enum.Event.html +//! [`on_event`]: ../trait.View.html#method.on_event +//! [global callback]: ../struct.Cursive.html#method.add_global_callback use crate::Cursive; use crate::Vec2; diff --git a/cursive-core/src/lib.rs b/cursive-core/src/lib.rs index edabf9e..48c7d69 100644 --- a/cursive-core/src/lib.rs +++ b/cursive-core/src/lib.rs @@ -4,7 +4,9 @@ //! //! The main purpose of `cursive-core` is to write third-party libraries to work with Cursive. //! -//! If you are building an end-user application, then `cursive` is probably what you want. +//! If you are building an end-user application, then [`cursive`] is probably what you want. +//! +//! [`cursive`]: https://docs.rs/cursive #![deny(missing_docs)] macro_rules! new_default( diff --git a/cursive-core/src/logger.rs b/cursive-core/src/logger.rs index 5823836..5cecbca 100644 --- a/cursive-core/src/logger.rs +++ b/cursive-core/src/logger.rs @@ -22,7 +22,9 @@ pub struct Record { } lazy_static! { - /// Circular buffer for logs. Use it to implement `DebugView`. + /// Circular buffer for logs. Use it to implement [`DebugView`]. + /// + /// [`DebugView`]: ../views/struct.DebugView.html pub static ref LOGS: Mutex> = Mutex::new(VecDeque::new()); } diff --git a/cursive-core/src/menu.rs b/cursive-core/src/menu.rs index 8e838c0..614db8e 100644 --- a/cursive-core/src/menu.rs +++ b/cursive-core/src/menu.rs @@ -10,7 +10,8 @@ //! //! The [menubar] is the main way to show menus. //! -//! [menubar]: crate::Cursive::menubar +//! [`MenuTree`]: struct.MenuTree.html +//! [menubar]: ../struct.Cursive.html#method.menubar use crate::event::Callback; use crate::Cursive; diff --git a/cursive-core/src/theme/mod.rs b/cursive-core/src/theme/mod.rs index f681473..587b632 100644 --- a/cursive-core/src/theme/mod.rs +++ b/cursive-core/src/theme/mod.rs @@ -5,6 +5,8 @@ //! Characters can be printed in the terminal with a specific color. //! The [`Color`] enum represents the ways this can be set. //! +//! [`Color`]: enum.Color.html +//! //! # Palette //! //! To achieve a customizable, yet unified look, Cursive uses a configurable @@ -12,6 +14,8 @@ //! //! The [`PaletteColor`] enum defines possible entries in this palette. //! +//! [`PaletteColor`]: enum.PaletteColor.html +//! //! These entries are: //! //! * **`Background`**: used to color the application background @@ -40,6 +44,8 @@ //! //! A [`Palette`] then maps each of these to an actual [`Color`]. //! +//! [`Palette`]: struct.Palette.html +//! //! # Color Types //! //! When drawing views, color can be picked in two way: @@ -50,6 +56,8 @@ //! //! The [`ColorType`] enum abstract over these two choices. //! +//! [`ColorType`]: enum.ColorType.html +//! //! # Color Styles //! //! To actually print anything, two colors must be picked: one for the @@ -57,6 +65,8 @@ //! //! As such, a [`ColorStyle`] is made of a pair of `ColorType`. //! +//! [`ColorStyle`]: struct.ColorStyle.html +//! //! Since some pairs are frequently used, `ColorStyle` defines some methods to //! create these usual values: //! @@ -106,6 +116,8 @@ //! Finally, a style combine a [`ColorType`] and a set of [`Effect`]s, to //! represent any way text should be printed on screen. //! +//! [`Effect`]: enum.Effect.html +//! //! # Themes //! //! A theme defines the color palette an application will use, as well as diff --git a/cursive-core/src/utils/markup/mod.rs b/cursive-core/src/utils/markup/mod.rs index b12e8f4..2f80884 100644 --- a/cursive-core/src/utils/markup/mod.rs +++ b/cursive-core/src/utils/markup/mod.rs @@ -15,6 +15,8 @@ use crate::utils::span::{IndexedSpan, Span, SpannedString}; /// /// **Note**: due to limitations in rustdoc, you will need to read the /// documentation from the [`SpannedString`] page. +/// +/// [`SpannedString`]: ../span/struct.SpannedString.html pub type StyledString = SpannedString