Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Warnings" in docs show blank lines with numbers if line numbers in examples are turned on #3211

Open
paul-hansen opened this issue Feb 5, 2025 · 0 comments

Comments

@paul-hansen
Copy link

Bug Report

Version

main and latest (e.g. tracing/0.1.41) on docs.rs

Crates

tracing
tracing-subscriber
tracing-core

Description

Turning on "Show line numbers on code examples" in the documentation shows line numbers above the warnings in some of the tracing crates. This seems to be because tracing crates use the example-wrap class for their warnings.

Show example image of how to turn on line numbers

Image

Example

From https://docs.rs/tracing/0.1.41/tracing/index.html

Image

Proposed solution

It looks like rustdoc has a documented way to format a warning block, maybe that should be used? I'd be happy to make a PR if desired.
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#adding-a-warning-block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant