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

Make h2 headings hyperlinks #92057

Closed
wants to merge 1 commit into from
Closed

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Dec 18, 2021

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Dec 18, 2021
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @CraftSpider

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 18, 2021
@@ -1068,8 +1068,9 @@ fn render_assoc_items_inner(
write!(
tmp_buf,
"<h2 id=\"{id}\" class=\"small-section-header\">\
<a href=\"#{id}\">\
<span>Methods from {trait_}&lt;Target = {type_}&gt;</span>\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trait_ is a link, so that won't work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for type_ btw.

@GuillaumeGomez
Copy link
Member

Also small UI issue:

Screenshot from 2021-12-18 15-45-23

@jsha
Copy link
Contributor Author

jsha commented Dec 19, 2021

Updated so the Methods from heading isn't a hyperlink (because it contains other hyperlinks). That fixes the UI issue. I also pushed an update to the demo.

@@ -1129,6 +1129,7 @@ a.test-arrow:hover{
text-decoration: none;
}

.small-section-header:hover a:before,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of this change, the anchor on Methods from Deref<Target = str> targets str, is blue and overlaps the text too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@GuillaumeGomez
Copy link
Member

Screenshot from 2021-12-31 18-19-41

:)

@jsha
Copy link
Contributor Author

jsha commented Jan 2, 2022

k, I think I've got it with this latest revision. Pushed and update to the demo.

@@ -23,7 +23,7 @@ assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"})

// We move the cursor over the "Implementations" title so the anchor is displayed.
move-cursor-to: "h2#implementations"
assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"})
assert-css: ("h2#implementations", {"color": "rgb(0, 0, 0)"})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's supposed to check that the anchor is displayed, which isn't tested here.

@bors
Copy link
Contributor

bors commented Jan 6, 2022

☔ The latest upstream changes (presumably #92609) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha
Copy link
Contributor Author

jsha commented Jan 6, 2022

I'm going to set this aside for a while. The amount of work required to make everything work right is not worth the benefit.

@jsha jsha closed this Jan 6, 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) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Harmonize colors for prose headings
5 participants