bevy/docs-rs
SpecificProtagonist d0caea0882
Relationship(…Target) html trait tag (#18140)
# Objective

Fixes #18117

These are component subtraits, but unlike for `Event` (before that bound
got removed) this still shows it as a component because it's actually
used as such.

## Testing

```sh
 RUSTDOCFLAGS="--html-after-content docs-rs/trait-tags.html --cfg docsrs_dep" RUSTFLAGS="--cfg docsrs_dep" cargo doc --no-deps --package bevy_ecs
```

---

## Showcase

![Screenshot from 2025-03-03
17-31-24](https://github.com/user-attachments/assets/4b152b3f-f9c3-4ee6-a3d4-ad10f09040b6)
2025-03-04 08:05:16 +00:00
..
README.md Trait tags on docs.rs (#17758) 2025-02-11 22:13:38 +00:00
trait-tags.html Relationship(…Target) html trait tag (#18140) 2025-03-04 08:05:16 +00:00

Docs.rs Extensions

This directory includes some templates and styling to extend and modify rustdoc's output for Bevy's documentation on docs.rs. Currently this consists of tags indicating core bevy_ecs traits.

3rd Party Crates

To use in your own crate, first copy this folder into your project, then add the following to your Cargo.toml:

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs_dep"]
rustdoc-args = [
    "--cfg", "docsrs_dep",
    "--html-after-content", "docs-rs/trait-tags.html",
]

[lints.rust]
unexpected_cfgs = { check-cfg = ['cfg(docsrs_dep)'] }

Local Testing

Build the documentation with the extension enabled like this:

RUSTDOCFLAGS="--html-after-content docs-rs/trait-tags.html --cfg docsrs_dep" RUSTFLAGS="--cfg docsrs_dep" cargo doc --no-deps --package <package_name>