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
//! 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.
///

View File

@ -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:

View File

@ -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;

View File

@ -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(

View File

@ -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<VecDeque<Record>> =
Mutex::new(VecDeque::new());
}

View File

@ -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;

View File

@ -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

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
/// documentation from the [`SpannedString`] page.
///
/// [`SpannedString`]: ../span/struct.SpannedString.html
pub type StyledString = SpannedString<Style>;
/// Indexes a span into a source string.

View File

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

View File

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

View File

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

View File

@ -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`]: ../backend/trait.Backend.html
#[cfg(unix)]
mod resize;