-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix : Rustdoc: struct fields are spaced too closely #128541
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @notriddle (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
what you think @notriddle ?? |
Please upload screenshots of the two pages (mir::Body and hir::Item) for these changes? It’s easier than having to tweak it myself. |
@@ -10,7 +10,7 @@ <h2 id="fields" class="fields section-header"> {# #} | |||
{% for (field, ty) in self.fields_iter() %} | |||
{% let name = field.name.expect("union field name") %} | |||
<span id="structfield.{{ name }}" {#+ #} | |||
class="{{ ItemType::StructField +}} section-header"> {# #} | |||
class="structfield {{ ItemType::StructField +}} section-header"> {# #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the structfield
class is already applied using ItemType::StructField
.
class="structfield {{ ItemType::StructField +}} section-header"> {# #} | |
class="{{ ItemType::StructField +}} section-header"> {# #} |
Just a small ping @xonx4l to check with you if you still plan to work on this. |
yeah I will be back at it once I get free from work. |
I've just tried to use the changes in this PR but was unable to do so. |
@@ -350,6 +350,14 @@ a.test-arrow { | |||
margin-bottom: 1em; | |||
} | |||
|
|||
.structfield { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized but you didn't modify the correct css file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is wrong, how did you get those screenshots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By modifying the CSS in the web page directly.
…-between-struct-fields-and-their-descriptions, r=GuillaumeGomez fix(rustdoc): add space between struct fields and their descriptions Stolen from rust-lang#128541. Fixes rust-lang#128260. <table> <thead> <tr> <th scope="col">Before</th> <th scope="col">After</th> </tr> </thead> <tbody> <tr> <td scope="row"> <img src="https://github.com/user-attachments/assets/b1d3cb47-77c9-4897-a5d2-2192b11cb8a3" /> </td> <td> <img src="https://github.com/user-attachments/assets/0b104672-d2be-49f4-ac9b-3506526fe2f1" /> </td> </tr> </tbody> </table> <table> <thead> <tr> <th scope="col">Before</th> <th scope="col">After</th> </tr> </thead> <tbody> <tr> <td scope="row"> <img src="https://github.com/user-attachments/assets/650c3e74-a067-492a-9ba3-557f9214f875" /> </td> <td> <img src="https://github.com/user-attachments/assets/413ef9b0-8fca-4e16-978a-7b88d05299dc" /> </td> </tr> </tbody> </table> Unlike original PR, I didn't add space between field headers; I put it between headers and descriptions. So if there are only headers, the space is not changed. Otherwise, I put a space like the space between paragraphs (.75em) which makes sense for me but feel free to adjust it or ask me to do so. r? `@GuillaumeGomez`
Rollup merge of rust-lang#131394 - ismailarilik:fix/rustdoc/add-space-between-struct-fields-and-their-descriptions, r=GuillaumeGomez fix(rustdoc): add space between struct fields and their descriptions Stolen from rust-lang#128541. Fixes rust-lang#128260. <table> <thead> <tr> <th scope="col">Before</th> <th scope="col">After</th> </tr> </thead> <tbody> <tr> <td scope="row"> <img src="https://github.com/user-attachments/assets/b1d3cb47-77c9-4897-a5d2-2192b11cb8a3" /> </td> <td> <img src="https://github.com/user-attachments/assets/0b104672-d2be-49f4-ac9b-3506526fe2f1" /> </td> </tr> </tbody> </table> <table> <thead> <tr> <th scope="col">Before</th> <th scope="col">After</th> </tr> </thead> <tbody> <tr> <td scope="row"> <img src="https://github.com/user-attachments/assets/650c3e74-a067-492a-9ba3-557f9214f875" /> </td> <td> <img src="https://github.com/user-attachments/assets/413ef9b0-8fca-4e16-978a-7b88d05299dc" /> </td> </tr> </tbody> </table> Unlike original PR, I didn't add space between field headers; I put it between headers and descriptions. So if there are only headers, the space is not changed. Otherwise, I put a space like the space between paragraphs (.75em) which makes sense for me but feel free to adjust it or ask me to do so. r? `@GuillaumeGomez`
This PR was superseeded by #131394. Closing then. |
Closes #128260
Description -:
Implement spacing between struct fields.