From 36e2d1bda1d8b4e1d0fbd09ba2894d56bd7eeeca Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Wed, 20 Nov 2024 04:17:13 -0800 Subject: [PATCH] fix: add feature(doc_cfg) when generating docs (#1506) --- ratatui-core/src/lib.rs | 7 +++++++ ratatui-widgets/src/lib.rs | 7 +++++++ ratatui/src/lib.rs | 15 ++++++++------- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ratatui-core/src/lib.rs b/ratatui-core/src/lib.rs index fa1ae2cd..56c60d52 100644 --- a/ratatui-core/src/lib.rs +++ b/ratatui-core/src/lib.rs @@ -1,3 +1,10 @@ +// show the feature flags in the generated documentation +#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![doc( + html_logo_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/logo.png", + html_favicon_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/favicon.ico" +)] //! **ratatui-core** is the core library of the [ratatui] project, //! providing the essential building blocks for creating rich terminal user interfaces in Rust. //! diff --git a/ratatui-widgets/src/lib.rs b/ratatui-widgets/src/lib.rs index 90933d93..68b50f73 100644 --- a/ratatui-widgets/src/lib.rs +++ b/ratatui-widgets/src/lib.rs @@ -1,3 +1,10 @@ +// show the feature flags in the generated documentation +#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![doc( + html_logo_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/logo.png", + html_favicon_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/favicon.ico" +)] #![warn(missing_docs)] //! **ratatui-widgets** contains all the widgets that were previously part of the [Ratatui] crate. //! It is meant to be used in conjunction with `ratatui`, which provides the core functionality diff --git a/ratatui/src/lib.rs b/ratatui/src/lib.rs index f426bcd9..b20d36ca 100644 --- a/ratatui/src/lib.rs +++ b/ratatui/src/lib.rs @@ -1,3 +1,11 @@ +// show the feature flags in the generated documentation +#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![doc( + html_logo_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/logo.png", + html_favicon_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/favicon.ico" +)] +#![warn(missing_docs)] //! ![Demo](https://github.com/ratatui/ratatui/blob/87ae72dbc756067c97f6400d3e2a58eeb383776e/examples/demo2-destroy.gif?raw=true) //! //!
@@ -318,13 +326,6 @@ //! [Forum]: https://forum.ratatui.rs //! [Sponsors Badge]: https://img.shields.io/github/sponsors/ratatui?logo=github&style=flat-square&color=1370D3 -// show the feature flags in the generated documentation -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -#![doc( - html_logo_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/logo.png", - html_favicon_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/favicon.ico" -)] - /// re-export the `crossterm` crate so that users don't have to add it as a dependency #[cfg(feature = "crossterm")] pub use crossterm;