From 9f6517e408f3a4b0a3fb00387a99deade55d6528 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 11 Jan 2024 23:43:17 +0100 Subject: [PATCH] stm32,nrf: add warning on docs.rs directing the user to docs.embassy.dev. --- embassy-nrf/Cargo.toml | 1 + embassy-nrf/src/lib.rs | 4 ++++ embassy-stm32/Cargo.toml | 1 + embassy-stm32/src/lib.rs | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 712cfb56f..39b4cc598 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml @@ -17,6 +17,7 @@ flavors = [ [package.metadata.docs.rs] features = ["nrf52840", "time", "defmt", "unstable-pac", "gpiote", "time-driver-rtc1"] +rustdoc-args = ["--cfg", "docsrs"] [features] default = ["rt"] diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index 1510b7265..d9c92a76d 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs @@ -1,5 +1,9 @@ #![no_std] #![allow(async_fn_in_trait)] +#![cfg_attr( + docsrs, + doc = "

You might want to browse the `embassy-nrf` documentation on the Embassy website instead.

The documentation here on `docs.rs` is built for a single chip only (nRF52840 in particular), while on the Embassy website you can pick your exact chip from the top menu. Available peripherals and their APIs change depending on the chip.

\n\n" +)] #![doc = include_str!("../README.md")] #![warn(missing_docs)] diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 98292af79..3b9f07e49 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -33,6 +33,7 @@ flavors = [ [package.metadata.docs.rs] features = ["defmt", "unstable-pac", "exti", "time-driver-any", "time", "stm32h755zi-cm7"] +rustdoc-args = ["--cfg", "docsrs"] [dependencies] embassy-sync = { version = "0.5.0", path = "../embassy-sync" } diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 18871e83b..a465fccd8 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs @@ -1,5 +1,9 @@ #![cfg_attr(not(test), no_std)] #![allow(async_fn_in_trait)] +#![cfg_attr( + docsrs, + doc = "

You might want to browse the `embassy-stm32` documentation on the Embassy website instead.

The documentation here on `docs.rs` is built for a single chip only (STM32H755 in particular), while on the Embassy website you can pick your exact chip from the top menu. Available peripherals and their APIs change depending on the chip.

\n\n" +)] #![doc = include_str!("../README.md")] #![warn(missing_docs)]