Use nightly doc_cfg feature only when building docs.

This commit is contained in:
Mario Carbajal 2024-01-10 14:52:18 -03:00
parent c3363fbc72
commit b153460484
4 changed files with 8 additions and 2 deletions

2
justfile Normal file
View File

@ -0,0 +1,2 @@
build-docs:
RUSTDOCFLAGS="--cfg docsrs" cargo doc -p stylance -p stylance-cli --all-features --open

View File

@ -17,3 +17,4 @@ notify = "6.1.1"
[[bin]] [[bin]]
name = "stylance" name = "stylance"
path = "./src/main.rs" path = "./src/main.rs"
doc = false

View File

@ -15,3 +15,6 @@ stylance-macros = { workspace = true }
[package.metadata.stylance] [package.metadata.stylance]
folders = ["examples"] folders = ["examples"]
[package.metadata.docs.rs]
all-features = true

View File

@ -57,7 +57,7 @@
//! //!
//! //!
#![feature(doc_cfg)] #![cfg_attr(docsrs, feature(doc_cfg))]
#[doc(hidden)] #[doc(hidden)]
pub use stylance_macros::*; pub use stylance_macros::*;
@ -92,7 +92,7 @@ pub use stylance_macros::*;
/// pub const contents: &str = "contents-539306b"; /// pub const contents: &str = "contents-539306b";
/// } /// }
/// ``` /// ```
#[doc(cfg(feature = "nightly"))] #[cfg_attr(docsrs, doc(cfg(feature = "nightly")))]
#[macro_export] #[macro_export]
macro_rules! import_style { macro_rules! import_style {
($ident:ident, $str:expr) => { ($ident:ident, $str:expr) => {