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

rustdoc adds extra spaces where it shouldn't #42013

Closed
steveklabnik opened this issue May 15, 2017 · 7 comments
Closed

rustdoc adds extra spaces where it shouldn't #42013

steveklabnik opened this issue May 15, 2017 · 7 comments
Assignees
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@steveklabnik
Copy link
Member

As seen here: https://doc.rust-lang.org/std/sync/struct.Weak.html

These docs:

/// pointer, which returns an [`Option`]`<`[`Arc`]`<T>>`.

render like this:

optionarc

Those extra spaces shouldn't be there.

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 15, 2017
@Mark-Simulacrum
Copy link
Member

https://doc.rust-lang.org/nightly/std/sync/struct.Weak.html is a better link, I think -- stable doesn't have this documentation quite yet.

@steveklabnik
Copy link
Member Author

gah, yes, thank you

@tommyip
Copy link
Contributor

tommyip commented May 15, 2017

Seems like a problem with CSS padding of <code> blocks.
The current rendered HTML looks like:

<a href="../../std/option/enum.Option.html"><code>Option</code></a>
<code>&lt;</code>
<a href="struct.Arc.html"><code>Arc</code></a>
<code>&lt;T&gt;&gt;</code>

I guess we want it to be like:

<code>
    <a href="../../std/option/enum.Option.html">Option</a>
    &lt;
    <a href="struct.Arc.html">Arc</a>
    &lt;T&gt;&gt;
</code>

@GuillaumeGomez
Copy link
Member

That's wanted. I added it this way to make easier to spot if different types are present.

@frewsxcv frewsxcv added the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
@kzys
Copy link
Contributor

kzys commented Sep 1, 2018

Personally I don't like the spacing. IDEs and even other sections in Rustdoc (e.g. pub fn upgrade(&self) -> Option<Arc<T>>) doesn't have spacing around types like that.

Or maybe we can change padding from 0.2em to 0.1em?

@joshtriplett
Copy link
Member

👍 for fixing this spacing.

@GuillaumeGomez
Copy link
Member

Ok, I'll reduce it (but won't remove it).

@GuillaumeGomez GuillaumeGomez self-assigned this Sep 18, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this issue Sep 25, 2018
… r=QuietMisdreavus

Reduce code block sides padding

Fixes rust-lang#42013.

<img width="1440" alt="screen shot 2018-09-19 at 22 58 32" src="https://user-images.githubusercontent.com/3050060/45781266-c6525680-bc5f-11e8-8eb0-98fc4c22a96e.png">

r? @QuietMisdreavus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants