Skip to content

rustdoc: highlight all anchored headings on click #86012

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

Closed
jsha opened this issue Jun 4, 2021 · 2 comments
Closed

rustdoc: highlight all anchored headings on click #86012

jsha opened this issue Jun 4, 2021 · 2 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Jun 4, 2021

When you visit on a rustdoc URL with a fragment linking to a specific method (e.g. https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.as_bytes), or when you click an internal link from the sidebar, the method declaration is highlighted.

However, if you click an internal section heading in the sidebar, or visit a URL with such a fragment, there is no highlighting. This is particularly noticeable on short pages (like module pages, e.g. https://doc.rust-lang.org/nightly/std/option/index.html#enums), where the section heading can't be moved all the way to the top of the page. You can wind up clicking on a sidebar link and not immediately seeing the heading you selected because it's towards the bottom of the page.

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-js Area: Rustdoc's JS front-end labels Jun 4, 2021
@inquisitivecrystal
Copy link
Contributor

inquisitivecrystal commented Jun 5, 2021

@rustbot label T-rustdoc C-enhancement

@rustbot rustbot added T-rustdoc C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jun 5, 2021
@jyn514 jyn514 added A-rustdoc-ui Area: Rustdoc UI (generated HTML) and removed A-rustdoc-js Area: Rustdoc's JS front-end labels Aug 16, 2021
@jsha
Copy link
Contributor Author

jsha commented Jan 12, 2022

Fixed!

@jsha jsha closed this as completed Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants