From fffadac04decea41bfbb7058f289cd87ff8028e4 Mon Sep 17 00:00:00 2001 From: PoiScript Date: Sun, 27 Oct 2019 14:29:21 +0800 Subject: [PATCH] docs: fix some broken links --- src/export/html.rs | 2 +- src/export/mod.rs | 6 ++++-- src/lib.rs | 24 +++++++++++++----------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/export/html.rs b/src/export/html.rs index 65829e1..7e1ccef 100644 --- a/src/export/html.rs +++ b/src/export/html.rs @@ -9,7 +9,7 @@ use crate::export::write_datetime; /// A wrapper for escaping sensitive characters in html. /// /// ```rust -/// use orgize::export::html::Escape; +/// use orgize::export::HtmlEscape as Escape; /// /// assert_eq!(format!("{}", Escape("< < <")), "< < <"); /// assert_eq!( diff --git a/src/export/mod.rs b/src/export/mod.rs index f42b111..09641eb 100644 --- a/src/export/mod.rs +++ b/src/export/mod.rs @@ -1,9 +1,11 @@ //! Export `Org` struct to various formats. -pub mod html; -pub mod org; +mod html; +mod org; pub use html::{DefaultHtmlHandler, Escape as HtmlEscape, HtmlHandler}; +#[cfg(feature = "syntect")] +pub use html::SyntectHtmlHandler; pub use org::{DefaultOrgHandler, OrgHandler}; use std::io::{Error, Write}; diff --git a/src/lib.rs b/src/lib.rs index 8328c62..56c6971 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ //! //! To parse a orgmode string, simply invoking the [`Org::parse`] function: //! -//! [`Org::parse`]: org/struct.Org.html#method.parse +//! [`Org::parse`]: struct.Org.html#method.parse //! //! ```rust //! use orgize::Org; @@ -16,7 +16,7 @@ //! //! or [`Org::parse_with_config`]: //! -//! [`Org::parse_with_config`]: org/struct.Org.html#method.parse_with_config +//! [`Org::parse_with_config`]: struct.Org.html#method.parse_with_config //! //! ```rust //! use orgize::{Org, ParseConfig}; @@ -36,8 +36,8 @@ //! [`Org::iter`] function will returns an iteractor of [`Event`]s, which is //! a simple wrapper of [`Element`]. //! -//! [`Org::iter`]: org/struct.Org.html#method.iter -//! [`Event`]: iter/enum.Event.html +//! [`Org::iter`]: struct.Org.html#method.iter +//! [`Event`]: enum.Event.html //! [`Element`]: elements/enum.Element.html //! //! ```rust @@ -51,16 +51,16 @@ //! **Note**: whether an element is container or not, it will appears twice in one loop. //! One as [`Event::Start(element)`], one as [`Event::End(element)`]. //! -//! [`Event::Start(element)`]: iter/enum.Event.html#variant.Start -//! [`Event::End(element)`]: iter/enum.Event.html#variant.End +//! [`Event::Start(element)`]: enum.Event.html#variant.Start +//! [`Event::End(element)`]: enum.Event.html#variant.End //! //! # Render html //! //! You can call the [`Org::html`] function to generate html directly, which //! uses the [`DefaultHtmlHandler`] internally: //! -//! [`Org::html`]: org/struct.Org.html#method.html -//! [`DefaultHtmlHandler`]: export/html/struct.DefaultHtmlHandler.html +//! [`Org::html`]: struct.Org.html#method.html +//! [`DefaultHtmlHandler`]: export/struct.DefaultHtmlHandler.html //! //! ```rust //! use orgize::Org; @@ -79,8 +79,8 @@ //! To customize html rendering, simply implementing [`HtmlHandler`] trait and passing //! it to the [`Org::html_with_handler`] function. //! -//! [`HtmlHandler`]: export/html/trait.HtmlHandler.html -//! [`Org::html_with_handler`]: org/struct.Org.html#method.html_with_handler +//! [`HtmlHandler`]: export/trait.HtmlHandler.html +//! [`Org::html_with_handler`]: struct.Org.html#method.html_with_handler //! //! The following code demonstrates how to add a id for every headline and return //! own error type while rendering. @@ -212,7 +212,9 @@ //! //! + `chrono`: adds the ability to convert `Datetime` into `chrono` structs, disabled by default. //! -//! + `syntect`: provides `SyntectHtmlHandler` for highlighting code block, disabled by default. +//! + `syntect`: provides [`SyntectHtmlHandler`] for highlighting code block, disabled by default. +//! +//! [`SyntectHtmlHandler`]: export/struct.SyntectHtmlHandler.html //! //! # License //!