document canvas field on window in wasm#4683
document canvas field on window in wasm#4683mockersf wants to merge 1 commit intobevyengine:mainfrom
Conversation
| pub transparent: bool, | ||
| #[cfg(target_arch = "wasm32")] | ||
| /// This field is only available in wasm. Can take a CSS selector to an HTML canvas | ||
| #[cfg(any(target_arch = "wasm32", doc))] |
There was a problem hiding this comment.
Maybe use #[doc(cfg(target_arch = "wasm32"))] too? That shows the cfg as part of the documentation. I'm not sure if it is stable already, but if not you could gate it to docs.rs.
There was a problem hiding this comment.
It's unstable: https://doc.rust-lang.org/rustdoc/unstable-features.html#doccfg-recording-what-platforms-or-features-are-required-for-code-to-be-present
Do you know if it or https://doc.rust-lang.org/rustdoc/unstable-features.html#doc_auto_cfg-automatically-generate-doccfg would be stabilised soon?
I'm not sure how to gate it for docs.rs, it seems it's only available through a var env in a build.rs script: https://docs.rs/about/builds#detecting-docsrs
|
closed in favour of #4726 which remove the wasm32 limit on the field |
Objective
Solution