Closed JohnTheCoolingFan closed 1 year ago
Unfortunately, replacing all #[cfg(feature = "screen")]
with #[cfg(any(feature = "screen", doc))]
results in an error:
>cargo doc
...
error[E0463]: can't find crate for `framebuffer`
--> src\lib.rs:37:1
|
37 | extern crate framebuffer;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error[E0463]: can't find crate for `image`
--> src\lib.rs:40:1
|
40 | extern crate image;
| ^^^^^^^^^^^^^^^^^^^ can't find crate
For more information about this error, try `rustc --explain E0463`.
error: could not document `ev3dev-lang-rust`
Besides that, I think it would be important to show that the "screen" feature is needed. Example: However, the required "doc_cfg" feature is still experimental
Thanks for the suggestions. This is now implemented. docsrs
seems to use nightly rust by default. And with #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
the automatic feature documentation for docsrs
can be enabled conditionally.
This will show the API on docs.rs. Just use
#[cfg(any(feature = "screen", doc))]
. Maybe I'll do a PR later