Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #37728 - QuietMisdreavus:rustdoc-enum-struct, r=Guillau…
…meGomez rustdoc: fold fields for enum struct variants into a docblock Per discussion in #37500, this PR updates the enum rendering code to wrap variants with named struct fields in a `docblock` span that is hidden automatically upon load of the page. This gives struct variant fields a clean separation from other enum variants, giving a boost to the readability of such documentation. Preview output is available [on the issue page](#37500 (comment)), but for the sake of completeness I'll include the images here again. ![rustdoc struct enum variant 4 part 1](https://cloud.githubusercontent.com/assets/5217170/20231925/96160b7e-a82a-11e6-945b-bbba95c5e4bc.PNG) When you initially load the page, there's a line under variants with struct fields letting you know you can click to expand the listing. ![rustdoc struct enum variant 4 part 2](https://cloud.githubusercontent.com/assets/3050060/20232067/1dc63266-a866-11e6-9555-8fb1c8afdcec.png) If you click to expand, the header and table unfold into a nicely-indented listing. If you want to take a look in your own browser and screen size, [I've got this version hosted on my server](https://shiva.icesoldier.me/doctest/doctest/enum.OldTopicRemoval.html). Fixes #37500 r? @GuillaumeGomez
- Loading branch information