From 1a469759a29388aa5e403cade80fb5dc2f4d8def Mon Sep 17 00:00:00 2001 From: Rahix Date: Thu, 23 Jun 2022 18:12:49 +0200 Subject: [PATCH] Only build docs for some MCUs on docs.rs Sadly we are now starting to hit the limits of docs.rs with the amount of supported MCUs. Only build documentation for a subset there and mention that docs for the rest can be built locally. Ref: #98 --- Cargo.toml | 7 ++++++- src/lib.rs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c8ebdd0..bd9d39d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ include = [ ] [package.metadata.docs.rs] -all-features = true +features = ["docsrs"] [features] device-selected = [] @@ -52,6 +52,11 @@ attiny88 = ["device-selected"] attiny1614 = ["device-selected"] rt = ["avr-device-macros"] +# Unfortunately, we can only build documentation for a subset of the supported +# MCUs on docs.rs. If you think a very popular chip is missing from the list, +# feel free to add it here. +docsrs = ["rt", "atmega328p", "atmega32u4", "atmega2560", "attiny85", "atmega4809"] + [dependencies] bare-metal = "0.2.5" vcell = "0.1.2" diff --git a/src/lib.rs b/src/lib.rs index 5f8790b..7aaf85d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,6 +28,10 @@ #![cfg_attr(feature = "attiny88", doc = "**attiny88**,")] //! and a few things which apply to AVR microcontrollers generally. //! +#![cfg_attr( + feature = "docsrs", + doc = "**Warning**: The doc-build here on docs.rs is only for a subset of supported chips. Please build documentation locally if your MCU's registers are not documented here.\n\n" +)] //! Which chips the crate is built for depends on the feature flag used. //! The following chips are available (using feature flags of the same name): //! * `at90usb1286` -- 2.49.0