Skip to content

fix(rustdoc): add space between struct fields and their descriptions #131394

New issue

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

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

Already on GitHub? # to your account

Conversation

ismailarilik
Copy link
Contributor

Stolen from #128541.
Fixes #128260.

Before After
Before After

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

@rustbot rustbot added 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. labels Oct 8, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 8, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@GuillaumeGomez
Copy link
Member

I think it's a good change for the fields, but not for the methods.

@ismailarilik
Copy link
Contributor Author

ismailarilik commented Oct 8, 2024

I see. So I reverted changes and got code from the original PR and edited it. I decreased margin sizes so that they seems OK for both cases IMHO. How is it now:

Before After
Before After

I can add another CSS rule for the case there is no description, but it would be complicated so I don't favor it.

@ismailarilik ismailarilik force-pushed the fix/rustdoc/add-space-between-struct-fields-and-their-descriptions branch from c301569 to 0c728c1 Compare October 8, 2024 10:11
@ismailarilik ismailarilik force-pushed the fix/rustdoc/add-space-between-struct-fields-and-their-descriptions branch from 0c728c1 to 076927b Compare October 8, 2024 13:06
@GuillaumeGomez
Copy link
Member

I forgot to approve it. Sorry about that.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 11, 2024

📌 Commit 076927b has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#129079 (Create `_imp__` symbols also when doing ThinLTO)
 - rust-lang#131208 (ABI: Pass aggregates by value on AIX)
 - rust-lang#131394 (fix(rustdoc): add space between struct fields and their descriptions)
 - rust-lang#131519 (Use Default visibility for rustc-generated C symbol declarations)
 - rust-lang#131541 (compiletest: Extract auxiliary-crate properties to their own module/struct)
 - rust-lang#131542 (next-solver: remove outdated FIXMEs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 103c716 into rust-lang:master Oct 11, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
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`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Rustdoc: struct fields are spaced too closely
4 participants