diff --git a/Cargo.toml b/Cargo.toml index eee87153..4910572a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,10 @@ exclude = [ resolver = "2" edition = "2018" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [profile.release] lto = true diff --git a/src/lib.rs b/src/lib.rs index 268dfdd6..e4558382 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,6 +59,7 @@ //! # } //! ``` +#![cfg_attr(docsrs, feature(doc_cfg))] #![deny( missing_docs, missing_debug_implementations, diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 74bcc0b2..7348464d 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -329,8 +329,8 @@ pub struct ComrakExtensionOptions { pub front_matter_delimiter: Option, #[cfg(feature = "shortcodes")] - /// Available if "shortcodes" feature is enabled. Phrases wrapped inside of ':' blocks will be - /// replaced with emojis. + #[cfg_attr(docsrs, doc(cfg(feature = "shortcodes")))] + /// Phrases wrapped inside of ':' blocks will be replaced with emojis. /// /// ``` /// # use comrak::{markdown_to_html, ComrakOptions}; diff --git a/src/plugins/mod.rs b/src/plugins/mod.rs index 2fd02e26..18165982 100644 --- a/src/plugins/mod.rs +++ b/src/plugins/mod.rs @@ -1,4 +1,5 @@ //! Plugins for enhancing the default implementation of comrak can be defined in this module. #[cfg(feature = "syntect")] +#[cfg_attr(docsrs, doc(cfg(feature = "syntect")))] pub mod syntect;