embed-changelog 0.1.2

A helper macro to embed changelogs in crate docs.
Documentation
//! A crate for embedding change logs into rust docs.
//!
//! ## Usage
//!
//! ```rust,ignore
//! /// Changelogs generated by [scuffle_changelog]
//! #[cfg(feature = "docs")]
//! #[scuffle_changelog::changelog]
//! pub mod changelog {}
//! ```
//!
//! ## License
//!
//! This project is licensed under the MIT or Apache-2.0 license.
//! You can choose between one of them if you use this work.
//!
//! `SPDX-License-Identifier: MIT OR Apache-2.0`
#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(missing_docs)]
#![deny(unsafe_code)]
#![deny(unreachable_pub)]
#![deny(clippy::mod_module_files)]

use proc_macro::TokenStream;

mod macro_impl;

/// Embed changelogs from `CHANGELOG.md`
#[proc_macro_attribute]
pub fn changelog(attr: TokenStream, item: TokenStream) -> TokenStream {
    match macro_impl::changelog(attr.into(), item.into()) {
        Ok(tokens) => tokens.into(),
        Err(err) => err.into_compile_error().into(),
    }
}