How to generate table of content in documentation

Hello,

The tracing crate documentation has table of content on the right side of the screen: tracing - Rust

How to tell rust doc to generate it? I doesn't appear when I build my own crate locally with cargo doc.

Is this a docs.rs feature?

Do you have this extension installed ? https://rust.extension.sh/

I think what you're seeing is injected by this extension on docs.rs, but not on your localhost.

3 Likes

The real thing was actually just added to nightly rustdoc: rustdoc: add header map to the table of contents by notriddle · Pull Request #120736 · rust-lang/rust · GitHub

Newly built crates have it, like nightly std.

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.