diff --git a/src/doc.rs b/src/doc.rs index fca304a..6b1e7d5 100644 --- a/src/doc.rs +++ b/src/doc.rs @@ -26,6 +26,24 @@ //! Documentation +// Rust 1.54 stabilized invoking function-like macros in attributes. +// We will use it after bumping MSRV. +// #![feature(extended_key_value_attributes)], +// #[doc = include_str!("../NEWS")] +// pub mod news {} +macro_rules! doc_module_with_external_source { + ($( #[$attr:meta] )* + $name: ident, $doc: expr) => { + $( #[$attr] )* + #[doc = ""] + #[doc = $doc] + pub mod $name {} + } +} +doc_module_with_external_source!( + /// # News + news, include_str!("../NEWS")); + /// # Upgrade Guide /// /// ## Upgrade from 0.4.x to 0.5.x