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

Fix display of enums with subfields #90061

Closed
jsha opened this issue Oct 19, 2021 · 3 comments · Fixed by #90089
Closed

Fix display of enums with subfields #90061

jsha opened this issue Oct 19, 2021 · 3 comments · Fixed by #90089
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Oct 19, 2021

https://docs.rs/xmlparser/0.13.4/xmlparser/enum.Token.html

image

(I've expanded one of the "Show fields" toggles in the above screenshot)

Problems:

  • The font weight of "Fields of Comment" is higher than the font weight of the "Comment" heading above it. "Comment" should be larger and heavier weight - similar to the weight of methods. And "Fields of _" should be lightweight.
  • "Fields of Comment" is an <h3>, but "Comment" is not a heading at all. This should be reversed.

EDIT(camelid): The toggles seen in the image above have already been removed. See #90061 (comment) for an updated screenshot.

@jsha jsha added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Oct 19, 2021
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 19, 2021
@camelid
Copy link
Member

camelid commented Oct 19, 2021

I'm pretty sure I got rid of the variant fields toggle a couple months ago; those docs were generated back in June. So I think the toggle-related problems have already been fixed :)

EDIT: I removed the toggles in #87332.

@jsha
Copy link
Contributor Author

jsha commented Oct 19, 2021

Confirmed. Here's what it looks like built with nightly:

image

Thanks for fixing the toggles!

@camelid
Copy link
Member

camelid commented Oct 20, 2021

The font weight of "Fields of Comment" is higher than the font weight of the "Comment" heading above it. "Comment" should be larger and heavier weight - similar to the weight of methods. And "Fields of _" should be lightweight.

I fully agree with this. I find the current styling very confusing to look at. Also, I think we should replace "Fields of Comment" with just "Fields" — it's more consistent with other parts of the docs and less redundant.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 19, 2021
…d,GuillaumeGomez

Improve display of enum variants

Use h3 and h4 for the variant name and the "Fields" subheading.
Remove the "of T" part of the "Fields" subheading.
Remove border-bottom from "Fields" subheading.
Move docblock below "Fields" listing.

Fixes rust-lang#90061

Demo:

https://jacob.hoffman-andrews.com/rust/xmlparser-updated/xmlparser/enum.Token.html#variants
https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/io/enum.ErrorKind.html#variants
https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/result/enum.Result.html#variants

r? `@camelid`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 19, 2021
…d,GuillaumeGomez

Improve display of enum variants

Use h3 and h4 for the variant name and the "Fields" subheading.
Remove the "of T" part of the "Fields" subheading.
Remove border-bottom from "Fields" subheading.
Move docblock below "Fields" listing.

Fixes rust-lang#90061

Demo:

https://jacob.hoffman-andrews.com/rust/xmlparser-updated/xmlparser/enum.Token.html#variants
https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/io/enum.ErrorKind.html#variants
https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/result/enum.Result.html#variants

r? `@camelid`
@bors bors closed this as completed in c0695bb Nov 20, 2021
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) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants