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

Add line numbers to crate/**/source/ #2560

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

xFrednet
Copy link
Member

@xFrednet xFrednet commented Jul 18, 2024

Pretty much what the title says. This adds line numbers to the source view that allow the same selection and URL behavior like rustdoc.

On desktop it looks like this:

image

And the phone view also works:

image


I'm not an HTML/CSS expert, and this change proofed that again. It took way too long to get the proper layout. But now it seems to work now, as I wanted. :D

I wasn't able to create the layout using the pure-* classes, as it would separate the line numbers from the code block for small screens. That's why I added a new class. I'm also not sure if I placed the CSS in the correct files. If you want anything moved around, please let me know!


Closes: #2551

r? syphar

Also thank you to @syphar for giving me guidance in the issue! ❤️

@xFrednet xFrednet requested a review from a team as a code owner July 18, 2024 13:39
@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jul 18, 2024
@GuillaumeGomez
Copy link
Member

Apart from the small nits, looks great, nice work!

@xFrednet xFrednet force-pushed the 2551-source-line-labels branch from a7c4f6d to ef58ec2 Compare July 18, 2024 16:57
Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@GuillaumeGomez
Copy link
Member

@syphar: We'll really need to add GUI tests for things like source code pages. ^^'

@syphar syphar merged commit 3d843d0 into rust-lang:master Jul 30, 2024
11 checks passed
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jul 30, 2024
@xFrednet xFrednet deleted the 2551-source-line-labels branch July 30, 2024 08:52
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Jul 31, 2024
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

Successfully merging this pull request may close these issues.

Add lines labels to /crate/**/source/
3 participants