Fix doc links accross re-use

This commit is contained in:
Alexandre Bury 2020-05-26 11:01:28 -07:00
parent f8d34b8c52
commit 0a14106127
12 changed files with 48 additions and 10 deletions

View File

@ -3,9 +3,11 @@
//! Cursive doesn't print anything by itself: it delegates this job to a //! Cursive doesn't print anything by itself: it delegates this job to a
//! backend library, which handles all actual input and output. //! 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 //! using some common libraries. Each of those included backends needs a
//! corresonding feature to be enabled. //! corresonding feature to be enabled.
//!
//! [`Backend`]: trait.Backend.html
use crate::event::Event; use crate::event::Event;
use crate::theme; 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 /// or termion, or it can entirely simulate a terminal and show it as a
/// graphical window (`BearLibTerminal`). /// 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. /// provide a backend initializer - usually their `init()` function.
/// ///
/// Backends are responsible for handling input and converting it to `Event`. Input must be /// Backends are responsible for handling input and converting it to [`Event`].
/// non-blocking, it will be polled regularly. /// Input must be non-blocking, it will be polled regularly.
///
/// [1]: ../struct.Cursive.html#method.new
/// [`Event`]: ../event/enum.Event.html
pub trait Backend { pub trait Backend {
/// Polls the backend for any input. /// Polls the backend for any input.
/// ///

View File

@ -2,6 +2,9 @@
//! //!
//! This module defines two main concepts: [`Orientation`] and [`Direction`]. //! This module defines two main concepts: [`Orientation`] and [`Direction`].
//! //!
//! [`Orientation`]: enum.Orientation.html
//! [`Direction`]: enum.Direction.html
//!
//! ### Orientation //! ### Orientation
//! //!
//! `Orientation` is a simple enum that can take two values: //! `Orientation` is a simple enum that can take two values:

View File

@ -9,8 +9,9 @@
//! choose to consume it or not. //! choose to consume it or not.
//! * If no view consumes the event, the [global callback] table is checked. //! * If no view consumes the event, the [global callback] table is checked.
//! //!
//! [`on_event`]: crate::View::on_event //! [`Event`]: enum.Event.html
//! [global callback]: crate::Cursive::add_global_callback //! [`on_event`]: ../trait.View.html#method.on_event
//! [global callback]: ../struct.Cursive.html#method.add_global_callback
use crate::Cursive; use crate::Cursive;
use crate::Vec2; use crate::Vec2;

View File

@ -4,7 +4,9 @@
//! //!
//! The main purpose of `cursive-core` is to write third-party libraries to work with Cursive. //! 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)] #![deny(missing_docs)]
macro_rules! new_default( macro_rules! new_default(

View File

@ -22,7 +22,9 @@ pub struct Record {
} }
lazy_static! { 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<VecDeque<Record>> = pub static ref LOGS: Mutex<VecDeque<Record>> =
Mutex::new(VecDeque::new()); Mutex::new(VecDeque::new());
} }

View File

@ -10,7 +10,8 @@
//! //!
//! The [menubar] is the main way to show menus. //! 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::event::Callback;
use crate::Cursive; use crate::Cursive;

View File

@ -5,6 +5,8 @@
//! Characters can be printed in the terminal with a specific color. //! Characters can be printed in the terminal with a specific color.
//! The [`Color`] enum represents the ways this can be set. //! The [`Color`] enum represents the ways this can be set.
//! //!
//! [`Color`]: enum.Color.html
//!
//! # Palette //! # Palette
//! //!
//! To achieve a customizable, yet unified look, Cursive uses a configurable //! To achieve a customizable, yet unified look, Cursive uses a configurable
@ -12,6 +14,8 @@
//! //!
//! The [`PaletteColor`] enum defines possible entries in this palette. //! The [`PaletteColor`] enum defines possible entries in this palette.
//! //!
//! [`PaletteColor`]: enum.PaletteColor.html
//!
//! These entries are: //! These entries are:
//! //!
//! * **`Background`**: used to color the application background //! * **`Background`**: used to color the application background
@ -40,6 +44,8 @@
//! //!
//! A [`Palette`] then maps each of these to an actual [`Color`]. //! A [`Palette`] then maps each of these to an actual [`Color`].
//! //!
//! [`Palette`]: struct.Palette.html
//!
//! # Color Types //! # Color Types
//! //!
//! When drawing views, color can be picked in two way: //! When drawing views, color can be picked in two way:
@ -50,6 +56,8 @@
//! //!
//! The [`ColorType`] enum abstract over these two choices. //! The [`ColorType`] enum abstract over these two choices.
//! //!
//! [`ColorType`]: enum.ColorType.html
//!
//! # Color Styles //! # Color Styles
//! //!
//! To actually print anything, two colors must be picked: one for the //! 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`. //! 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 //! Since some pairs are frequently used, `ColorStyle` defines some methods to
//! create these usual values: //! create these usual values:
//! //!
@ -106,6 +116,8 @@
//! Finally, a style combine a [`ColorType`] and a set of [`Effect`]s, to //! Finally, a style combine a [`ColorType`] and a set of [`Effect`]s, to
//! represent any way text should be printed on screen. //! represent any way text should be printed on screen.
//! //!
//! [`Effect`]: enum.Effect.html
//!
//! # Themes //! # Themes
//! //!
//! A theme defines the color palette an application will use, as well as //! A theme defines the color palette an application will use, as well as

View File

@ -15,6 +15,8 @@ use crate::utils::span::{IndexedSpan, Span, SpannedString};
/// ///
/// **Note**: due to limitations in rustdoc, you will need to read the /// **Note**: due to limitations in rustdoc, you will need to read the
/// documentation from the [`SpannedString`] page. /// documentation from the [`SpannedString`] page.
///
/// [`SpannedString`]: ../span/struct.SpannedString.html
pub type StyledString = SpannedString<Style>; pub type StyledString = SpannedString<Style>;
/// Indexes a span into a source string. /// Indexes a span into a source string.

View File

@ -2,6 +2,8 @@ use crate::view::View;
use crate::views::NamedView; use crate::views::NamedView;
/// Makes a view wrappable in an [`NamedView`]. /// Makes a view wrappable in an [`NamedView`].
///
/// [`NamedView`]: ../views/struct.NamedView.html
pub trait Nameable: View + Sized { pub trait Nameable: View + Sized {
/// Wraps this view into an `NamedView` with the given id. /// Wraps this view into an `NamedView` with the given id.
/// ///

View File

@ -3,6 +3,8 @@ use crate::views::ResizedView;
use crate::Vec2; use crate::Vec2;
/// Makes a view wrappable in a [`ResizedView`]. /// Makes a view wrappable in a [`ResizedView`].
///
/// [`ResizedView`]: ../views/struct.ResizedView.html
pub trait Resizable: View + Sized { pub trait Resizable: View + Sized {
/// Same as [`resized`](Resizable::resized) /// Same as [`resized`](Resizable::resized)
#[deprecated(note = "Use `Resizable::resized()` instead.")] #[deprecated(note = "Use `Resizable::resized()` instead.")]

View File

@ -17,6 +17,8 @@ type InnerContentType = Arc<StyledString>;
/// Provides access to the content of a [`TextView`]. /// Provides access to the content of a [`TextView`].
/// ///
/// [`TextView`]: struct.TextView.html
///
/// Cloning this object will still point to the same content. /// Cloning this object will still point to the same content.
/// ///
/// # Examples /// # Examples
@ -59,6 +61,8 @@ impl TextContent {
/// ///
/// This can be deref'ed into a [`StyledString`]. /// This can be deref'ed into a [`StyledString`].
/// ///
/// [`StyledString`]: ../utils/markup/type.StyledString.html
///
/// This keeps the content locked. Do not store this! /// This keeps the content locked. Do not store this!
pub struct TextContentRef { pub struct TextContentRef {
_handle: OwningHandle< _handle: OwningHandle<

View File

@ -3,9 +3,11 @@
//! Cursive doesn't print anything by itself: it delegates this job to a //! Cursive doesn't print anything by itself: it delegates this job to a
//! backend library, which handles all actual input and output. //! 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 //! using some common libraries. Each of those included backends needs a
//! corresonding feature to be enabled. //! corresonding feature to be enabled.
//!
//! [`Backend`]: ../backend/trait.Backend.html
#[cfg(unix)] #[cfg(unix)]
mod resize; mod resize;