From d65ccedc22749be022f8febb30483c7270bc50fe Mon Sep 17 00:00:00 2001 From: KAMADA Ken'ichi Date: Sun, 1 Aug 2021 23:40:11 +0900 Subject: [PATCH] Link to the NEWS file from rustdoc. --- src/doc.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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